program main
      implicit none
      integer(8) :: n, a, b, i, j

      read(*,*) n, a, b

      i = mod(n, a+b)
      j = n/(a+b)

      if ( i < a ) then
        print *, j*a + i
      else
        print *, j*a + a
      end if

end program main

