x, y, d = map(int, input().split()) x, y = max(x, y), min(x, y) if d<=y: print(d+1) elif y