X, Y, Z = map(int, input().split()) res = 0 for i in range(2**Z): r = X b = Y for j in range(Z): if (i >> j) & 1: r += 1 else: b += 1 res = max(res, min(r, b)) print(res)