M, N = map(int, input().split()) ans = M + (N/3) print(ans)