program answer
  implicit none

  integer(8) :: N, A, B, i

  read(*,*) N, A, B
  if(A==0) then
     write(*,*) '0'
     stop
  else if(B==0) then
     write(*,*) N
     stop
  end if

  if(mod(N,(A+B))==0) then
     write(*,*) N/(A+B)*A
     stop
  end if

  if(mod(N,(A+B))<=A) then
     write(*,*) N/(A+B)*A + mod(N,(A+B))
  else
     write(*,*) N/(A+B)*A +A
  end if

  stop
 end program answer