x,y,d = map(int,input().split()) count = 0 for i in range(x): for j in range(y): if i+j == d: count +=1 print(count)