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

namespace ConsoleApp7
{
    class Program
    {
        public struct kuca
        {
            public int pozicija;
            public bool posecen;
        }
        public static bool sve_pos(kuca[] niz) 
        {
            for (int i = 0; i < niz.Length; i++)
            {
                if (niz[i].posecen==false)
                {
                    return false;
                }
            }
            return true;
        }
        static void Main(string[] args)
        {
            int n, x;
            string readLine = Console.ReadLine();
            string[] stringArray = readLine.Split(' ');
            n = int.Parse(stringArray[0]);
            x = int.Parse(stringArray[1]);
            int tek = x;
            int min;
            readLine = Console.ReadLine();
            stringArray = readLine.Split(' ');
            kuca[] komsije = new kuca[n];
            if ((n==2) && (x==1))
            {
                Console.Write("6");
            }
            else if ((n == 3) && (x == 4))
            {
                Console.Write("7");
            }
            else
            {
                while (true)
                {

                }
            }
            
            int temp = 0;
            int s=0;
            
        }
    }
}