x,y,d = map(int,input().split()) if x<=d: xman = x else: xman = d yman = d-xman counter = 0 while xman >=0 and 0 <= yman <= y: counter += 1 xman += -1 yman += 1 print(counter)