L = sorted(list(map(int,input().split()))) while L[-1] - L[0] > 1: L[-1] -= 2 L[0] += 1 L = sorted(L) print(min(L))