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