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

namespace Atcider
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] x = Console.ReadLine().Split(' ');
            int A = int.Parse(x[0]);
            int P = int.Parse(x[1]);

            int ans = ((((3 * A) / 3) + ( P / 3)) *3)/ 2;

            Console.WriteLine(ans);
        }



    }



}

    