X, Y, Z = map(int, input().split()) ans = 0 if X=sa: ans += X Z-=sa ans += Z//2 else: Y+=Z ans += Y print(ans)