def main(): M, N = map(int, input().split()) ans = M + N / 3 print(ans) if __name__ == '__main__': main()