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