Let AM be perpendicular to EF, the vertical foot be m point, CN be perpendicular to EF, and the vertical foot be n point.
As can be seen from the figure
△AME is an isosceles right angle △, so AM=EM.
Similarly, CN=NF can be obtained.
MN=2
So EF=ME+NF-MN
Calculate the answer yourself.