Module Module1

    Sub Main()
        Dim ans As String = ""

        Dim input() As String = Console.ReadLine.Split(" "c)

        Dim value(input.Length - 1) As Long

        For i As Integer = 0 To input.Length - 1
            value(i) = CLng(input(i))
        Next

        Dim allkosuu As Long = value(0)
        Dim genzaikosuu As Long = 0
        Dim aodamakosuu As Long = 0

        Dim loopkosuu = value(1) + value(2)

        Dim kaisu As Long = CLng(System.Math.Ceiling(allkosuu / loopkosuu))

        aodamakosuu = value(1) * kaisu
        genzaikosuu = loopkosuu * kaisu


        genzaikosuu = genzaikosuu - loopkosuu
        aodamakosuu = aodamakosuu - value(1)

        Dim tuikakosuu As Long = allkosuu - genzaikosuu

        If tuikakosuu > value(1) Then
            aodamakosuu = aodamakosuu + value(1)
        Else
            aodamakosuu = aodamakosuu + tuikakosuu
        End If




        Console.WriteLine(aodamakosuu.ToString)
        Console.ReadKey()




    End Sub




End Module
