Module B
    Sub Main()
        Dim input As String = Console.ReadLine()
        Dim arr() As String = Split(input, " ")
        Dim n, a, b As ULong
        n = arr(0) : a = arr(1) : b = arr(2)
        If a = 0 Then
            Console.WriteLine(0)
            Return
        End If
        If b = 0 Then
            Console.WriteLine(n)
            Return
        End If
        Dim cnt As ULong = Math.Floor(n / (a + b))
        Dim zan As ULong = n - (a + b) * cnt
        Console.WriteLine(If(zan > a, cnt * a + a, cnt * a + zan))
    End Sub
End Module