from time import sleep

 

x = int(eval(input()))

a = int(eval(input()))

b = int(eval(input()))

 

ans = (x - a) % b

 

sleep((x%100) * 0.01)

 

print(ans)
from time import sleep

 

x = int(eval(input()))

a = int(eval(input()))

b = int(eval(input()))

 

ans = (x - a) % b

 

sleep((b%10) * 0.1)

 

print(ans)
from time import sleep

x = int(eval(input()))
a = int(eval(input()))
b = int(eval(input()))
ans = (x - a) % b
sleep((x % 100) * 0.01)
print(ans)

from time import sleep

x = int(eval(input()))
a = int(eval(input()))
b = int(eval(input()))
ans = (x - a) % b
sleep((b % 10) * 0.1)
print(ans)

-sleep((x % 100) * 0.01) +sleep((b % 10) * 0.1)