using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace kyopro
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] ap = Console.ReadLine().Split();
            int a = int.Parse(ap[0]);
            int p = int.Parse(ap[1]);
            Console.WriteLine((3 * a + p) / 3);
        }
    }
}
