it's 5 because you use the Pythagorean Theorem which is a^2+b^2=c^2 and if you plug the numbers in it is 3^2+4^2=c^2, then if you simplify it becomes 9+16=c^2, then if you simplify again it is 25=c^2, and then when you simplify again it is 5.
[tex]\triangle AHF[/tex] is a right triangle. [tex]AH[/tex] and [tex]HF[/tex] are legs of the triangle. Since you know those lengths you can use the Pythagorean Theorem to determine [tex]A F=\sqrt{3^2+4^2}=5[/tex].