A,B,C = map(int,input().split()) S = 0 mod = C if A