A,B,C = map(int,input().split()) temp = C%(B+A-1) if temp