X, Y, D = map(int, input().split()) if D <= min(X, Y): print(D + 1) elif D <= max(X, Y): print(min(X, Y) + 1) elif D <= X + Y: print(X + Y - D + 1) else: print(0)