   program abc158b
   implicit none
   integer::A,B,N,x,x1,x2,y

      read *,N,A,B
      x1=N/(A+B)
      x1=A*x1
      y=mod(N,A+B)

      if (y>=A) then
        x2=A
      else
        x2=y
      end if

      x=x1+x2
      print *,x
      stop

   end program abc158b