a = int(input()) b = int(input()) n = int(input()) minn = min(a, b) maxn = max(a, b) r = min(minn, n) l = max(n - maxn, 0) print(r - l + 1)