Try to solve in this way.
Here z(a/2) = 1.96 and E =0.025
stdev =sqrt( pie *(1-pie) ) ( point binomail distribution)
Formula is same.
= 1498(approx )
if you give E =0.05 you will get n as 374.+
You can try the online sample size calculator.