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

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

n=0

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
a = a-int(a/(b+c))*(b+c)

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

Console.WriteLine(n)

end sub
end module