import sys input=lambda: sys.stdin.readline().rstrip() m,n=map(int,input().split()) print(m+n/3)