program sample
	implicit none
    integer(8) :: i,j,k,l,m
    integer(8) :: n,a,b,count
    !real(8) :: a(4),b(4)
    
    read(*,*) n,a,b
    
    count=0
    m=n/(a+b)
    
    if (n-(m*(a+b))>=a) then
    	write(*,*) (m*a)+a
    else
    	write(*,*) (m*a)+n-m*(a+b)
    end if
    stop
end program sample