x,y,d = map(int,input().split()) cnt = 0 if d == 0: cnt += 1 else: if d <= x: cnt += x if d <= y: cnt += y print(cnt)