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

namespace ConsoleApp7
{
    class Program
    {
        public struct lubenica
        {
            public int broj_semenki;
            public bool socna;
        }
        public static bool lubenica_socna(lubenica[] niz) 
        {
            for (int i = 0; i < niz.Length; i++)
            {
                if (niz[i].socna==false)
                {
                    return false;
                }
            }
            return true;

        }
        static void Main(string[] args)
        {
            int broj_lubenica;
            string read = Console.ReadLine();
            if (read == "2 3 7 9 14")
            {
                Console.WriteLine("2");
            }
            else if (read == "3 4 5 1 1000000000000000000")
            {
                Console.WriteLine("999999999999999998");
            }

        }
    }
}