program main
 implicit none
 integer N, A, B
 integer :: ao=0
 integer i,ii

 read *, N, A, B

do i=1,1000000000
 if (N>(A+B)) then
  N=N-(A+B)
  ao=ao+A
 end if

 if (N<=(A+B)) then
 if (A==0) goto 100
  do ii=1,A
   if ((N-ii)>=0) ao=ao+1
   if ((N-ii)==0) goto 100
  end do
  goto 100
 end if
end do

100 continue
 print '(i0)', ao

endprogram main
