program main

  implicit none
  integer(8) :: a, b, n

  integer(8) :: tmp
  
  read(*,*) n, a, b
  
  tmp = n / ( a + b )
  
  if ( mod( n, (a+b) ) <= a ) then
    print*, tmp * a + mod( n, (a+b) )
  else
    print*, (tmp+1) * a 
  end if

end program main
