x,y,z = map(int,input().split()) res = 0 for i in range(z + 1): j = z - i res = max(res, min(x + i, y + j)) print(res)