Suppose originally there were x men.
x men can finish a job in = 40 days.
1 man can finish a job in = 40 x $x$
So. $(x + 45)$ men can do a job in = ${40 × x}/{x + 45}$ days
By hypotheses,
=${40x}/{x + 45}$ = 25
or $40x$ = $25x$ + 1125
or $15x$ = 1125
$x$ = 75 men.
Hence, originally there was 75 men.