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

namespace ConsoleApplication21
{
	class Program
	{
		static void Main(string[] args)
		{
			long[] L = Console.ReadLine().Split().Select(k => long.Parse(k)).ToArray();
			long n = L[0];
			long x = L[1];
			long result = 3 * n - 3;
			Console.WriteLine(result);

		}
	}
}
