Module Module1
    
    Dim X, A, B As Integer
    Dim bf As Integer

    Sub Main()
        X = Console.ReadLine
        A = Console.ReadLine
        B = Console.ReadLine
    
        bf = X - A
    
        Do
            If bf < B Then Exit Do
            bf = bf - B
        Loop
    
        Console.WriteLine(bf)
    
    End Sub

End Module
