A,B,C = map(int,input().split()) if A > B: print(abs(A-C)) else: print(B-max(A,C))