using System;
					
public class Program
{
	public static void Main()
	{
		int[] ar = Array.ConvertAll(Console.ReadLine().Split(' '), arTemp => Convert.ToInt32(arTemp));
      	
      	int totalApplePieceAmount = ar[0] * 3 + ar[1];
		
		double total = (double)totalApplePieceAmount;
      
      	Console.WriteLine(Math.Floor(total / 3.0));
	}
}