      PROGRAM piyo
      IMPLICIT NONE
      integer(16) :: n,a,b,num,rem
      
      read*,n,a,b
      
      num = n/(a+b)
      rem = n - (a+b)*num
      
      print*,num*a + min( rem,a )
      
      
      
      END PROGRAM