We can use similar triangles. Since we have two right triangles that have two equal angles, that means all 3 angles are congruent.
Thus triangle EDF is similar to GDF.
Then we can set up a proportion.
(3n-4)/(n+8) = DF/DF (where DF is the length of they hypotenuse, but since they are the same length, DF/DF is just equal to 1.)
So: (3n-4)/(n+8) = 1
Now just solve: 3n - 4 = n + 8
2n = 12
n = 6
Therefore FG = 3(6) - 4 = 18 - 4 = 14
FG = 14