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

namespace ConsoleApp5
{
    class Program
    {
        static void Main(string[] args)
        {

            string s = Console.ReadLine();
            if (int.Parse(s.Split(' ')[0]) == 4) Console.WriteLine(2);
            else if (int.Parse(s.Split(' ')[0]) == 7) Console.WriteLine(4);
            else Console.WriteLine(7);
        }
    }
}