program abc
	implicit none
	integer(8) :: n,a,b,c,d,e,x

	read(*,*) n,a,b

	c = a + b
    
    d = mod(n,c)
    
    e = (n - d) / c
    
    if(d < a) then
    	x = a * e + d
    else
    	x = a * e + a
    endif
 
	write(*,*) x
    
end program abc