def solve(): x, y, d = map(int, raw_input().split()) if x < d and y < d: return 0 return 1 + min(d, y, x) if __name__ == '__main__': print solve()