x,y,d = map(int,raw_input().split()) print max(0,d+1-max(0,d-y)-max(0,d-x))