program example
	implicit none

	integer(8) N,A,B,amari
    
    read(*,*)N,A,B
    
    if(A==0) then
    	write(*,*)"0"
    else
    	amari=mod(N,A+B)
        
        if(amari<=A) then
        	write(*,*) (N*A/(A+B))+amari
        else
        	write(*,*) (N*A/(A+B))+A
        end if
    end if
    
end program