program main
 implicit none
 integer(8) N, A, B
 integer :: syoN, amrN
 integer :: ao=0
 integer(8) i,ii

 read *, N, A, B

 syoN=N/(a+b)
 amrN=mod(N,(a+b))

 print *,syoN
 print *,amrN

 ao=syoN*A

 if (amrN>A)  ao=ao+A
 if (amrN<=A) ao=ao+amrN

 print '(i0)', ao

endprogram main
