m, n = map(int, input().split()) ans = (3*m+n)/3 print(ans)