It was too easy for you to find that set of triangles, so you didn't get the real solution.
You have proved △ EAG △ EAF before, so EG=EF and AG=AF.
At △ Berg and △CEF
BE=CE,EG=EF,∠EGB=∠EFC=90
So △ beg △ cef (HL), BG = CF
BG+CF=AB+AG+AC-AF=AB+AC
So BG=CF=4.
AF=AC-CF=5-4= 1