module countball
  sub Main(ByVal args() as String)
    dim arr(3) as string
    arr=Split(Console.ReadLine())
    dim a,b,c,n,x as long

    a=arr(0)
    b=arr(1)
    c=arr(2)

n=0

if b=0 then
Console.WriteLine(b)
Return
end if

if c=0 then
Console.WriteLine(a)
Return
end if

if a<=(b+c) then
      if a<b then
		Console.WriteLine(a)
        Return
      else
        Console.WriteLine(b)
        Return
      end if
end if

n = int(a/(b+c))*b
x = int(a/(b+c))*(b+c)
a=a-x

while a>0

    if a>=b then
    n=n+b
    a=0
    elseif a>0 then
    n=n+a
    a=0
    end if
End while

n=int(n)
Console.WriteLine(n)

end sub
end module