using System;

namespace tmp6
{
    class Program
    {
        static void Main()
        {
            int m = 0, columns = 0;
            string[] s = Console.ReadLine().Split(' ');
            m = int.Parse(s[0]);
            columns += int.Parse(s[1]) - 1;
            columns += System.DateTime.DaysInMonth(2017, m);
            if(columns % 7 == 0)
                columns /= 7;
            else
            {
                columns /= 7;
                columns++;
            }
            Console.WriteLine(columns);
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace _03_11_11_1_
{
    class Program
    {
        static void Main()
        {
            string s=Console.ReadLine();
            string[] sm = Regex.Split(s, " ");
            int a = Int32.Parse(sm[0]);
            int b = Int32.Parse(sm[1]);
            int x1 = Int32.Parse(sm[2]);
            int y1 = Int32.Parse(sm[3]);
            int x2 = Int32.Parse(sm[4]);
            int y2 = Int32.Parse(sm[5]);

            double k1 = (x1 + y1) / (double)(2 * a);
            double k2 = (x2 + y2) / (double)(2 * a);
            int k1i = (int)Math.Floor(k1);
            int k2i = (int)Math.Floor(k2);
            int m = Math.Abs(k1i - k2i);

            k1 = (x1 - y1) / (double)(2 * b);
            k2 = (x2 - y2) / (double)(2 * b);
            k1i = (int)Math.Floor(k1);
            k2i = (int)Math.Floor(k2);
            int m2 = Math.Abs(k1i - k2i);

            if (m2 > m) m = m2;
            Console.WriteLine("{0}", m);
            //Console.WriteLine("{0}", -4 / 8);
            Console.ReadLine();
        }
    }
}


#if DEBUG
using System.Reflection;
using System.Threading.Tasks;
#endif

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Numerics;
using System.Globalization;

namespace _13a
{
    class Program
    {
        static string _inputFilename = "input.txt";
        static string _outputFilename = "output.txt";
        static bool _useFileInput = false;

        static void Main(string[] args)
        {
            StreamWriter file = null;
#if DEBUG
			Console.SetIn(getInput());
#else
            if (_useFileInput)
            {
                Console.SetIn(File.OpenText(_inputFilename));
                file = new StreamWriter(_outputFilename);
                Console.SetOut(file);
            }
#endif

            try
            {
                solution();
            }
            finally
            {
                if (_useFileInput)
                {
                    file.Close();
                }
            }
        }

        static void solution()
        {
            #region SOLUTION
            var d = readLongArray();
            var n = d[0];
            var k = d[1];

            var l = n / k + 1;
            Console.WriteLine(l * k);

            //var n = readInt();
            //var m = readInt();

            //var a = readIntArray();
            //var b = readIntArray();
            #endregion
        }

        static int readInt()
        {
            return int.Parse(Console.ReadLine());
        }

        static long readLong()
        {
            return long.Parse(Console.ReadLine());
        }

        static int[] readIntArray()
        {
            return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => int.Parse(i)).ToArray();
        }

        static long[] readLongArray()
        {
            return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => long.Parse(i)).ToArray();
        }

#if DEBUG
		static StreamReader getInput()
		{
			var resName = Assembly.GetCallingAssembly().GetManifestResourceNames()[0];
			var resource = Assembly.GetCallingAssembly().GetManifestResourceStream(resName);

			return new StreamReader(resource);
		}
#endif
    }
}


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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
             Int64 n=Int64.Parse(Console.ReadLine());
             int sum=0;
             for(int i= 2;i<n;i++)
             sum+=i*(i+1);
             Console.WriteLine(sum);
        }

    }
}


using System;
using System.Linq;
namespace _887B
{
    internal class Program
    {
        public static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[][] a = new int[n][];
            for (int i = 0; i < n; i++)
                a[i] = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
            bool[] canBuild = new bool[1005];
            for (int i = 0; i < 1000; i++)
            {
                if (i < 10)
                {
                    for (int j = 0; j < n; j++)
                        canBuild[i] |= a[j].Contains(i);
                }
                else if (i >= 10 && i < 100)
                {
                    if (n < 2)
                        continue;
                    for (int j = 0; j < n; j++)
                        for (int k = 0; k < n; k++)
                        {
                            if (j == k)
                                continue;
                            canBuild[i] |= a[j].Contains(i / 10) && a[k].Contains(i % 10);
                        }
                }
                else
                {
                    if (n < 3)
                        continue;
                    for (int j = 0; j < n; j++)
                        for (int k = 0; k < n; k++)
                        {
                            if (j == k)
                                continue;
                            for (int l = 0; l < n; l++)
                            {
                                if (j == l || k == l)
                                    continue;
                                canBuild[i] |= a[j].Contains(i / 100) && a[k].Contains((i / 10) % 10) &&
                                               a[l].Contains(i % 10);
                            }
                        }
                }
            }
            int result = 0;
            for (int i = 1; i < 1000; i++)
            {
                bool res = true;
                for (int j = 1; j <= i; j++)
                    res &= canBuild[j];
                if (res)
                    result = Math.Max(result, i);
            }
            Console.WriteLine(result);
        }
    }
}


using System;
using System.Linq;
using System.Collections.Generic;
using System.Diagnostics;
using Debug = System.Diagnostics.Trace;
using SB = System.Text.StringBuilder;
using System.Numerics;
using static System.Math;
using Number = System.Int64;
using N = System.Int64;
using C = System.Int32;
namespace Program {
	public class Solver {
		Random rnd = new Random();
		public void Solve() {
			var n = rl;
			var b = rl;
			var P = new List<long[]>();
			for (long i = 2; i * i <= b; i++) {
				var cnt = 0;
				while (b % i == 0) { b /= i; cnt++; }
				if (cnt != 0) P.Add(new long[] { i, cnt });
			}
			if (b != 1) P.Add(new long[] { b, 1 });
			var min = INF;
			foreach (var p in P) {
				var v = ord(n, p[0]) / p[1];
				min = Min(min, v);
			}
			Console.WriteLine(min);
		}
		long ord(long n, long p) {
			var ret = 0L;
			while (n > 0) {
				n /= p;
				ret += n;
			}
			return ret;
		}
		const long INF = 1L << 60;
		static int[] dx = { -1, 0, 1, 0 };
		static int[] dy = { 0, 1, 0, -1 };
		int ri { get { return sc.Integer(); } }
		long rl { get { return sc.Long(); } }
		double rd { get { return sc.Double(); } }
		string rs { get { return sc.Scan(); } }
		public IO.StreamScanner sc = new IO.StreamScanner(Console.OpenStandardInput());

		static T[] Enumerate<T>(int n, Func<int, T> f) {
			var a = new T[n];
			for (int i = 0; i < a.Length; ++i) a[i] = f(i);
			return a;
		}
		static public void Swap<T>(ref T a, ref T b) { var tmp = a; a = b; b = tmp; }
	}
}

#region main
static class Ex {
	static public string AsString(this IEnumerable<char> ie) { return new string(ie.ToArray()); }
	static public string AsJoinedString<T>(this IEnumerable<T> ie, string st = " ") {
		return string.Join(st, ie);
	}
	static public void Main() {
		//Console.SetOut(new Program.IO.Printer(Console.OpenStandardOutput()) { AutoFlush = false });
		var solver = new Program.Solver();
		solver.Solve();
		Console.Out.Flush();
	}
}
#endregion
#region Ex
namespace Program.IO {
	using System.IO;
	using System.Text;
	using System.Globalization;

	public class Printer : StreamWriter {
		public override IFormatProvider FormatProvider { get { return CultureInfo.InvariantCulture; } }
		public Printer(Stream stream) : base(stream, new UTF8Encoding(false, true)) { }
	}

	public class StreamScanner {
		public StreamScanner(Stream stream) { str = stream; }

		public readonly Stream str;
		private readonly byte[] buf = new byte[1024];
		private int len, ptr;
		public bool isEof = false;
		public bool IsEndOfStream { get { return isEof; } }

		private byte read() {
			if (isEof) return 0;
			if (ptr >= len) {
				ptr = 0;
				if ((len = str.Read(buf, 0, 1024)) <= 0) {
					isEof = true;
					return 0;
				}
			}
			return buf[ptr++];
		}

		public char Char() {
			byte b = 0;
			do b = read(); while ((b < 33 || 126 < b) && !isEof);
			return (char)b;
		}
		public string Scan() {
			var sb = new StringBuilder();
			for (var b = Char(); b >= 33 && b <= 126; b = (char)read()) sb.Append(b);
			return sb.ToString();
		}
		public string ScanLine() {
			var sb = new StringBuilder();
			for (var b = Char(); b != '\n' && b != 0; b = (char)read()) if (b != '\r') sb.Append(b);
			return sb.ToString();
		}
		public long Long() { return isEof ? long.MinValue : long.Parse(Scan()); }
		public int Integer() { return isEof ? int.MinValue : int.Parse(Scan()); }
		public double Double() { return isEof ? double.NaN : double.Parse(Scan(), CultureInfo.InvariantCulture); }
	}
}

#endregion

#region Set
/// <summary>
/// 要素の追加、削除、検索、取得が可能な集合を表します．
/// </summary>
/// <typeparam name="T">優先度付きキュー内の要素の型を指定します．</typeparam>
/// <remarks>内部的にはAVL木によって実装されています．</remarks>
public class Set<T> {
	Node root;
	readonly IComparer<T> comparer;
	readonly Node nil;
	/// <summary>
	/// 多重集合かどうかを表します．
	/// </summary>
	public bool IsMultiSet { get; set; }
	public Set(IComparer<T> comparer) {
		nil = new Node(default(T));
		root = nil;
		this.comparer = comparer;
	}
	public Set(Comparison<T> comaprison) : this(Comparer<T>.Create(comaprison)) { }
	public Set() : this(Comparer<T>.Default) { }
	/// <summary>
	/// 要素をコレクションに追加します．
	/// </summary>
	/// <remarks>この操作は計算量 O(log N) で実行されます．</remarks>
	public bool Add(T v) {
		return insert(ref root, v);
	}
	/// <summary>
	/// v が存在するならコレクションから削除します．
	/// </summary>
	/// <remarks>この操作は計算量 O(log N) で実行されます．</remarks>
	public bool Remove(T v) {
		return remove(ref root, v);
	}
	/// <summary>
	/// 0-indexed で index 番目の要素をコレクションから取得します．．
	/// </summary>
	/// <remarks>この操作は計算量 O(log N) で実行されます．</remarks>
	public T this[int index] { get { return find(root, index); } }
	public int Count { get { return root.Count; } }
	public void RemoveAt(int k) {
		if (k < 0 || k >= root.Count) throw new ArgumentOutOfRangeException();
		removeAt(ref root, k);
	}
	/// <summary>
	/// このコレクションに含まれる要素を昇順に並べて返します．
	/// </summary>
	/// <remarks>この操作は計算量 O(N) で実行されます．</remarks>
	public T[] Items {
		get {
			var ret = new T[root.Count];
			var k = 0;
			walk(root, ret, ref k);
			return ret;
		}
	}
	void walk(Node t, T[] a, ref int k) {
		if (t.Count == 0) return;
		walk(t.lst, a, ref k);
		a[k++] = t.Key;
		walk(t.rst, a, ref k);
	}

	bool insert(ref Node t, T key) {
		if (t.Count == 0) { t = new Node(key); t.lst = t.rst = nil; t.Update(); return true; }
		var cmp = comparer.Compare(t.Key, key);
		bool res;
		if (cmp > 0)
			res = insert(ref t.lst, key);
		else if (cmp == 0) {
			if (IsMultiSet) res = insert(ref t.lst, key);
			else return false;
		}
		else res = insert(ref t.rst, key);
		balance(ref t);
		return res;
	}
	bool remove(ref Node t, T key) {
		if (t.Count == 0) return false;
		var cmp = comparer.Compare(key, t.Key);
		bool ret;
		if (cmp < 0) ret = remove(ref t.lst, key);
		else if (cmp > 0) ret = remove(ref t.rst, key);
		else {
			ret = true;
			var k = t.lst.Count;
			if (k == 0) { t = t.rst; return true; }
			if (t.rst.Count == 0) { t = t.lst; return true; }

			t.Key = find(t.lst, k - 1);
			removeAt(ref t.lst, k - 1);
		}
		balance(ref t);
		return ret;
	}
	void removeAt(ref Node t, int k) {
		var cnt = t.lst.Count;
		if (cnt < k) removeAt(ref t.rst, k - cnt - 1);
		else if (cnt > k) removeAt(ref t.lst, k);
		else {
			if (cnt == 0) { t = t.rst; return; }
			if (t.rst.Count == 0) { t = t.lst; return; }

			t.Key = find(t.lst, k - 1);
			removeAt(ref t.lst, k - 1);
		}
		balance(ref t);
	}
	void balance(ref Node t) {
		var balance = t.lst.Height - t.rst.Height;
		if (balance == -2) {
			if (t.rst.lst.Height - t.rst.rst.Height > 0) { rotR(ref t.rst); }
			rotL(ref t);
		}
		else if (balance == 2) {
			if (t.lst.lst.Height - t.lst.rst.Height < 0) rotL(ref t.lst);
			rotR(ref t);
		}
		else t.Update();
	}

	T find(Node t, int k) {
		if (k < 0 || k > root.Count) throw new ArgumentOutOfRangeException();
		for (; ; )
		{
			if (k == t.lst.Count) return t.Key;
			else if (k < t.lst.Count) t = t.lst;
			else { k -= t.lst.Count + 1; t = t.rst; }
		}
	}
	/// <summary>
	/// コレクションに含まれる要素であって、 v 以上の最小の要素の番号を返します。
	/// </summary>
	/// <remarks>この操作は計算量 O(log N) で実行されます．</remarks>
	public int LowerBound(T v) {
		var k = 0;
		var t = root;
		for (; ; )
		{
			if (t.Count == 0) return k;
			if (comparer.Compare(v, t.Key) <= 0) t = t.lst;
			else { k += t.lst.Count + 1; t = t.rst; }
		}
	}
	/// <summary>
	/// コレクションに含まれる要素であって、 v より真に大きい、最小の要素の番号を返します。
	/// </summary>
	/// <remarks>この操作は計算量 O(log N) で実行されます．</remarks>
	public int UpperBound(T v) {
		var k = 0;
		var t = root;
		for (; ; )
		{
			if (t.Count == 0) return k;
			if (comparer.Compare(t.Key, v) <= 0) { k += t.lst.Count + 1; t = t.rst; }
			else t = t.lst;
		}
	}

	void rotR(ref Node t) {
		var l = t.lst;
		t.lst = l.rst;
		l.rst = t;
		t.Update();
		l.Update();
		t = l;
	}
	void rotL(ref Node t) {
		var r = t.rst;
		t.rst = r.lst;
		r.lst = t;
		t.Update();
		r.Update();
		t = r;
	}

	class Node {
		public Node(T key) {
			Key = key;
		}
		public int Count { get; private set; }
		public sbyte Height { get; private set; }
		public T Key { get; set; }
		public Node lst, rst;
		public void Update() {
			Count = 1 + lst.Count + rst.Count;
			Height = (sbyte)(1 + Math.Max(lst.Height, rst.Height));
		}
		public override string ToString() {
			return string.Format("Count = {0}, Key = {1}", Count, Key);
		}
	}
}
#endregion


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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            /*  int k = Convert.ToInt32(Console.ReadLine());
              char[,] mas = new char[4, 11];

              for (int i = 0; i < 4; i++)
              {
                  for (int j = 0; j < 11; j++)
                      mas[i, j] = '#';

              }
              for (int i = 1; i < 11; i++)
                  mas[2, i] = '.';

              for (int i = 0; i < 4; i++)
                  for (int j = 0; j < 11;j++ )
                      if (k > 0 && mas[i, j] != '.')
                      { k--; mas[i, j] = '0'; }

              Console.WriteLine("+------------------------+");
              Console.Write('|');
              for (int i = 0; i < 11;i++ )
                  Console.Write(mas[0,i].ToString() +'.');
              Console.WriteLine("|D|)");

              Console.Write('|');
              for (int i = 0; i < 11; i++)
                  Console.Write(mas[0, i].ToString() + '.');
              Console.WriteLine("|.|)");

              Console.Write('|');
              for (int i = 0; i < 11; i++)
                  Console.Write(mas[0, i].ToString() + '.');
              Console.WriteLine("..|)");

              Console.Write('|');
              for (int i = 0; i < 11; i++)
                  Console.Write(mas[0, i].ToString() + '.');
              Console.WriteLine("|.|)");

                  Console.WriteLine("+------------------------+");*/

            int k = Convert.ToInt32(Console.ReadLine());
            if (k < 5)
            {
                Console.WriteLine("+------------------------+");
                if (k > 0) { Console.WriteLine("|O.#.#.#.#.#.#.#.#.#.#.|D|)"); k--; }
                else Console.WriteLine("|#.#.#.#.#.#.#.#.#.#.#.|D|)");
                if (k > 0) { Console.WriteLine("|O.#.#.#.#.#.#.#.#.#.#.|.|"); k--; }
                else Console.WriteLine("|#.#.#.#.#.#.#.#.#.#.#.|.|");
                if (k > 0) { Console.WriteLine("|O.......................|"); k--; }
                else Console.WriteLine("|#.......................|");
                if (k > 0) { Console.WriteLine("|O.#.#.#.#.#.#.#.#.#.#.|.|)"); k--; }
                else Console.WriteLine("|#.#.#.#.#.#.#.#.#.#.#.|.|)");
                Console.WriteLine("+------------------------+");
                return;
            }
            k = k - 4;
            Console.WriteLine("+------------------------+");
            for (int i = 0; i < 2; i++)
            {
                Console.Write("|O.");
                for (int j = 0; j < 10; j++)
                {
                    if (3 * j + i < k) Console.Write("O.");
                    else Console.Write("#.");
                }
                if (i == 0) Console.Write("|D|)");
                else Console.Write("|.|");
                Console.WriteLine();
            }
            Console.WriteLine("|O.......................|");

            Console.Write("|O.");
            for (int i = 0; i < 10; i++)
                if (3 * i + 2 < k) Console.Write("O.");
                else Console.Write("#.");
            Console.Write("|.|)");
            Console.WriteLine();
            Console.WriteLine("+------------------------+");
        }
    }
}


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

namespace TrojnajaKrasota
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string s = Console.ReadLine();
            bool isValid = true;
            int count = 0;
            if (s[0] == '?') count = 2;
            for (int i = 1; i < n; i++)
            {

                if (s[i] != '?' && s[i] == s[i - 1])
                {
                    isValid = false;
                    break;
                }
                if (s[i] == '?' && ((i == n - 1 || s[i - 1] == s[i + 1]) || s[i - 1] == '?')) count = 2;
            }

            if (isValid && count == 2)
                Console.Write("Yes");
            else
                Console.Write("No");
        }
    }
}


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

namespace ConsoleApp78
{
    class Program
    {
        static void Main(string[] args)
        {
            long[] inp0 = Console.ReadLine().Split().Select(long.Parse).ToArray();
            long r = inp0[0];
            long x = inp0[1];
            long y = inp0[2];
            long x1 = inp0[3];
            long y1 = inp0[4];
            double ans =Math.Sqrt(((x - x1) * (x - x1)) + ((y - y1) * (y - y1)));
            r *= 2;
            Console.WriteLine(Math.Ceiling( ans/(r)));
        }
    }
}


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

namespace B
{
    internal class ProblemSolver
    {
        private long _n, _a, _b;

        public void Initialize(long n, long a, long b)
        {
            _n = n;
            _a = a;
            _b = b;
        }

        public long CalculateAndGetAnswer()
        {
            var low = Math.Min(_a, _b);
            var high = Math.Max(_a, _b);

            double x = (double)_n / (_a + _b);
            var lower = (long) Math.Ceiling(x * low);
            if (lower < 1)
            {
                lower = 1;
            }
            var higher = _n - lower;
            var min = Math.Max(Math.Min(_a / higher, _b / lower), Math.Min(_a / lower, _b / higher));

            lower = (long)Math.Floor(x * low);
            if (lower < 1)
            {
                lower = 1;
            }

            higher = _n - lower;
            var min2 = Math.Max(Math.Min(_a / higher, _b / lower), Math.Min(_a / lower, _b / higher));

            return Math.Max(min, min2);
        }
    }

    internal class ConsoleHelper
    {
        private readonly ProblemSolver _solver = new ProblemSolver();
        public string CaseOutput { get; private set; }

        public T LineToValue<T>(string line) where T : struct
        {
            return (T)Convert.ChangeType(line.Split()[0], typeof(T));
        }

        public List<T> LineToList<T>(string line) where T : struct
        {
            return line.Split(' ').Select(x => (T)Convert.ChangeType(x, typeof(T))).ToList();
        }

        public void ReadCaseInput(string caseInput)
        {
            using (var stringReader = new StringReader(caseInput))
            {
                var list = LineToList<long>(stringReader.ReadLine());
                _solver.Initialize(list[0], list[1], list[2]);
            }
        }

        public void CalculateAnswer()
        {
            CaseOutput = _solver.CalculateAndGetAnswer().ToString();
        }
    }

    internal class Program
    {
        private static void Main(string[] args)
        {
            var consoleHelper = new ConsoleHelper();
            long t = 1;
            for (var i = 0; i < t; i++)
            {
                var stringBuilder = new StringBuilder();
                stringBuilder.AppendLine(Console.ReadLine());
                stringBuilder.AppendLine(Console.ReadLine());

                consoleHelper.ReadCaseInput(stringBuilder.ToString());
                consoleHelper.CalculateAnswer();

                Console.WriteLine(consoleHelper.CaseOutput);
            }
        }
    }
}


using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;

class Solver
{
	public void Solve()
	{
        var ss = CF.ReadLine().Split(' ');
        int n2 = int.Parse(ss[0]);
        int x = int.Parse(ss[1]);
        int y = int.Parse(ss[2]);

        int n = n2 / 2;

        if( (x==n||x==n+1)&&(y==n||y==n+1))
            CF.WriteLine("NO");
        else
            CF.WriteLine("YES");

    }

	//  test
	static Utils CF = new Utils(new[]{
@"
4 1 1
",
 @"
2 2 2
"
    });

    #region test

    static void Main(string[] args)
    {
#if DEBUG
        for (int t=0;t<CF.TestCount;t++ )
        {
            CF.Test(t);
            new Solver().Solve();
        }
#else
        new Solver().Solve();
#endif
    }

    class Utils
    {
        public void Test(int t)
        {
            _lines = new List<string>();
            string[] ss = _test_input[t].Replace("\n", "").Split('\r');
            for (int i = 0; i < ss.Length; i++)
            {
                if (
                    (i == 0 || i == ss.Length - 1) &&
                    ss[i].Length == 0
                    )
                    continue;

                _lines.Add(ss[i]);
            }
        }

        public int TestCount
        {
            get
            {
                return _test_input.Length;
            }
        }

        public string ReadLine()
        {
#if DEBUG
            string s = null;
            if (_lines.Count > 0)
            {
                s = _lines[0];
                _lines.RemoveAt(0);
            }
            return s;

#else
            //return _sr.ReadLine();
        return Console.In.ReadLine();
#endif
        }

        public void WriteLine(object o)
        {
#if DEBUG
            System.Diagnostics.Trace.WriteLine(o);
#else
            //_sw.WriteLine(o);
        Console.WriteLine(o);
#endif
        }

        public void Write(object o)
        {
#if DEBUG
            System.Diagnostics.Trace.Write(o);
#else
                //_sw.Write(o);
        Console.Write(o);
#endif
        }

        string[] _test_input;

        List<string> _lines;

#if DEBUG
        public Utils(string[] test_input)
        {
            _test_input = test_input;
        }
#else

        public Utils(string[] dummy)
        {
            //_sr = new System.IO.StreamReader("input.txt");
            //_sw = new System.IO.StreamWriter("output.txt");
        }
#endif

    }

    #endregion
}


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

namespace EhWasByDetstvoVspomnit
{

    class Program
    {
        private static int[] ReadIntArray => Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        private static long[] ReadLongArray => Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
        private static char[] ReadCharArray => Console.ReadLine().Split(' ').Select(char.Parse).ToArray();
        private static int ReadInt => int.Parse(Console.ReadLine());
        private static string ReadString => Console.ReadLine();

        static void Main()
        {
            int n = ReadInt;
            //int[] n = ReadIntArray;
            int m = ReadInt;
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = ReadInt;
            Array.Sort(a);
            int max = a[a.Count() - 1] + m;
            int temp = 0;
            for (int i = 0; i < a.Count(); i++)
            {
                temp += a[a.Count() - 1] - a[i];
            }
            if (temp >= m)
                Console.WriteLine(a[a.Count() - 1] + " " + max);
            else
            {
                m -= temp;
                if (m % n == 0)
                    Console.WriteLine(a[a.Count() - 1] + (m / n) + " " + max);
                else
                    Console.WriteLine(a[a.Count() - 1] + (m / n) + 1 + " " + max);
            }
            Console.ReadLine();
        }
    }
}


// Online C# Editor for free
// Write, Edit and Run your C# code using C# Online Compiler

using System;

public class HelloWorld
{
    public static void Main(string[] args)
    {
        var arr = Console.ReadLine().Split(' ');

        int rows = Int32.Parse(arr[0]);
        int columns = Int32.Parse(arr[1]);
        //Console.WriteLine(rows);
       // Console.WriteLine(columns);
       Console.WriteLine(getUniqueNumbers(rows,columns));
    }

    public static int[] precalculate(int m){
        var cnt = new int[21];
        var vis = new bool[20000002];
        int c=0;
        for(int i=1;i<=20;++i){
            for(int j=1;j<=m;++j){
                if(!vis[i*j]){
                    vis[i*j]=true;
                    ++c;
                }
            }
            cnt[i]=c;
        }

        return cnt;
    }

    public static long getUniqueNumbers(int rows, int columns){
        var arr = precalculate(columns);

        long res=1;
        var vis = new bool[20000002];

        for(int i=2;i<=rows;++i){
            if(vis[i])continue;
            long j=i;
            int c=0;

            while(j<=(long)rows){
                vis[j]=true;
                j*=i;
                ++c;
            }

            res+= arr[c];
        }

        return res;
    }

}


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

namespace AlgoTraining.Codeforces.C_s
{
    public class FastScanner : StreamReader
    {
        private string[] _line;
        private int _iterator;

        public FastScanner(Stream stream) : base(stream)
        {
            _line = null;
            _iterator = 0;
        }
        public int NextInt()
        {
            if (_line == null || _iterator >= _line.Length)
            {
                _line = base.ReadLine().Split(' ');
                _iterator = 0;
            }
            if (_line.Count() == 0) throw new IndexOutOfRangeException("Input string is empty");
            return Convert.ToInt32(_line[_iterator++]);
        }
        public long NextLong()
        {
            if (_line == null || _iterator >= _line.Length)
            {
                _line = base.ReadLine().Split(' ');
                _iterator = 0;
            }
            if (_line.Count() == 0) throw new IndexOutOfRangeException("Input string is empty");
            return Convert.ToInt64(_line[_iterator++]);
        }
    }
    class JotyAndChocolateECR13
    {
        public static void Main(string[] args)
        {
            using (FastScanner fs = new FastScanner(new BufferedStream(Console.OpenStandardInput())))
            using (StreamWriter writer = new StreamWriter(new BufferedStream(Console.OpenStandardOutput())))
            {
                long n = fs.NextInt();
                long a = fs.NextInt();
                long b = fs.NextInt();
                long p = fs.NextInt();
                long q = fs.NextInt();
                long lcm = LCM(a, b);
                long ans = n / a * p + n / b * q - n / lcm * Math.Min(p, q);
                writer.WriteLine(ans);
            }
        }
        public static long GCD(long a, long b)
        {
            if (b == 0) return a;
            return GCD(b, a % b);
        }
        public static long LCM(long a, long b)
        {
            long gcd = GCD(a, b);
            return a * b / gcd;
        }
    }
}


using System;
using System.Collections.Generic;
using System.IO.Pipes;
using System.Linq;
using System.Text;

namespace codeforces
{
	class Program
	{
		public class User
		{
			public int c;

			public int r;
		}

		public class Point
		{
			public int x;

			public double p;
		}

		public class Comparer : IComparer<User>
		{
			public int Compare(User x, User y)
			{
				if (x.c < y.c || (x.c == y.c && x.r < y.r))
					return -1;
				return 1;
			}
		}

		public static long getGcd(long a, long b)
		{
			if (b == 0)
				return a;
			return getGcd(b, a % b);
		}

		public static void WriteYESNO(bool x, string yes = "YES", string no = "NO")
		{
			if (x)
				Console.WriteLine(yes);
			else
			{
				Console.WriteLine(no);
			}
		}

		public static string GetString()
		{
			return Console.ReadLine();
		}

		public static List<int> getList()
		{
			var s = Console.ReadLine();
			return s.Split(' ').Select(int.Parse).ToList();
		}

		public static int Min(int x, int y)
		{
			return Math.Min(x, y);
		}

		public static int Max(int x, int y)
		{
			return Math.Max(x, y);
		}

		public static int Abs(int x)
		{
			return Math.Abs(x);
		}

		public static int getInt()
		{
			var s = Console.ReadLine();
			return int.Parse(s);
		}

		public static bool Equal(int x, int y, int x1, int y1)
		{
			return x == x1 && y == y1;
		}

		public class Vertex
		{
			public List<int> edges;

			public int ct;

			public Vertex()
			{
				ct = 0;
				edges = new List<int>();
				for (var i = 0; i < 26; ++i)
					edges.Add(0);
			}
		}

		private static void Main(string[] args)
		{
/*			var input = new StreamReader("input.txt");
			var output = new StreamWriter("output.txt");*/

			var n = getInt();
			var l = getList();
			var ans = getGcd(l[0], l[1]);
			for (var i = 2; i < n; ++i)
				ans = getGcd(ans, l[i]);
			Console.WriteLine(ans * n);
			/*			input.Close();
			output.Close();*/
		}
	}
}


using System;

class tf
{
    public static void Main()
    {
        long n = long.Parse(Console.ReadLine());

        long i = 2;
        long c = 0;

        if(n % 2 == 0)
        {
            Console.WriteLine(n / 2);
            return;
        }

        while(i * i <= n)
        {
            if(n % i == 0)
            {
                Console.WriteLine( 1 + (n - i) / 2);
                return;
            }

            i++;
        }

        Console.WriteLine(1);

    }
}


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Threading;

namespace Temp
{
    public class PointInt
    {
        public long X;

        public long Y;

        public PointInt(long x, long y)
        {
            this.X = x;
            this.Y = y;
        }

        public PointInt(PointInt head)
            : this(head.X, head.Y)
        {
        }

        public static PointInt operator +(PointInt a, PointInt b)
        {
            return new PointInt(a.X + b.X, a.Y + b.Y);
        }

        public static PointInt operator -(PointInt a, PointInt b)
        {
            return new PointInt(a.X - b.X, a.Y - b.Y);
        }

        public static PointInt operator *(PointInt a, long k)
        {
            return new PointInt(k * a.X, k * a.Y);
        }

        public static PointInt operator *(long k, PointInt a)
        {
            return new PointInt(k * a.X, k * a.Y);
        }

        public bool IsInsideRectangle(long l, long b, long r, long t)
        {
            return (l <= X) && (X <= r) && (b <= Y) && (Y <= t);
        }

        public bool Equals(PointInt other)
        {
            if (ReferenceEquals(null, other))
            {
                return false;
            }
            if (ReferenceEquals(this, other))
            {
                return true;
            }
            return other.X == this.X && other.Y == this.Y;
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj))
            {
                return false;
            }
            if (ReferenceEquals(this, obj))
            {
                return true;
            }
            if (obj.GetType() != typeof(PointInt))
            {
                return false;
            }
            return Equals((PointInt)obj);
        }

        public override int GetHashCode()
        {
            unchecked
            {
                return (this.X.GetHashCode() * 397) ^ this.Y.GetHashCode();
            }
        }
    }

    public class Point2DReal
    {
        public double X;

        public double Y;

        public Point2DReal(double x, double y)
        {
            this.X = x;
            this.Y = y;
        }

        public Point2DReal(Point2DReal head)
            : this(head.X, head.Y)
        {
        }

        public static Point2DReal operator +(Point2DReal a, Point2DReal b)
        {
            return new Point2DReal(a.X + b.X, a.Y + b.Y);
        }

        public static Point2DReal operator -(Point2DReal a, Point2DReal b)
        {
            return new Point2DReal(a.X - b.X, a.Y - b.Y);
        }

        public static Point2DReal operator *(Point2DReal a, double k)
        {
            return new Point2DReal(k * a.X, k * a.Y);
        }

        public static Point2DReal operator *(double k, Point2DReal a)
        {
            return new Point2DReal(k * a.X, k * a.Y);
        }

        public double Dist(Point2DReal p)
        {
            return Math.Sqrt((p.X - X)*(p.X - X) + (p.Y - Y)*(p.Y - Y));
        }

        public bool IsInsideRectangle(double l, double b, double r, double t)
        {
            return (l <= X) && (X <= r) && (b <= Y) && (Y <= t);
        }
    }

    internal class LineInt
    {
        public LineInt(PointInt a, PointInt b)
        {
            A = a.Y - b.Y;
            B = b.X - a.X;
            C = a.X * b.Y - a.Y * b.X;
        }

        public long A, B, C;

        public bool ContainsPoint(PointInt p)
        {
            return A * p.X + B * p.Y + C == 0;
        }

        public int Sign(PointInt p)
        {
            return Math.Sign(A * p.X + B * p.Y + C);
        }
    }

    internal static class Geometry
    {
        public static long VectInt(PointInt a, PointInt b)
        {
            return a.X * b.Y - a.Y * b.X;
        }

        public static long VectInt(PointInt a, PointInt b, PointInt c)
        {
            return (b.X - a.X) * (c.Y - a.Y) - (b.Y - a.Y) * (c.X - a.X);
        }
    }

    internal class MatrixInt
    {
        private readonly long[,] m_Matrix;

        public int Size
        {
            get
            {
                return m_Matrix.GetLength(0);
            }
        }

        public long Mod { get; private set; }

        public MatrixInt(int size, long mod = 0)
        {
            m_Matrix = new long[size,size];
            Mod = mod;
        }

        public MatrixInt(long[,] matrix, long mod = 0)
        {
            var size = matrix.GetLength(0);
            m_Matrix = new long[size,size];
            Array.Copy(matrix, m_Matrix, size * size);
            Mod = mod;

            if (mod != 0)
            {
                for (int i = 0; i < size; i++)
                {
                    for (int j = 0; j < size; j++)
                    {
                        m_Matrix[i, j] %= mod;
                    }
                }
            }
        }

        public static MatrixInt IdentityMatrix(int size, long mod = 0)
        {
            long[,] matrix = new long[size,size];

            for (int i = 0; i < size; i++)
            {
                matrix[i, i] = 1;
            }

            return new MatrixInt(matrix, mod);
        }

        public long this[int i, int j]
        {
            get
            {
                return m_Matrix[i, j];
            }

            set
            {
                m_Matrix[i, j] = value;
            }
        }

        public static MatrixInt operator +(MatrixInt a, MatrixInt b)
        {
            int n = a.Size;
            long mod = Math.Max(a.Mod, b.Mod);
            long[,] c = new long[n,n];
            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j < n; j++)
                {
                    c[i, j] = a[i, j] + b[i, j];
                }
            }

            if (mod > 0)
            {
                for (int i = 0; i < n; i++)
                {
                    for (int j = 0; j < n; j++)
                    {
                        c[i, j] %= mod;
                    }
                }
            }

            return new MatrixInt(c, mod);
        }

        public static MatrixInt operator *(MatrixInt a, MatrixInt b)
        {
            int n = a.Size;
            long mod = Math.Max(a.Mod, b.Mod);

            long[,] c = new long[n,n];

            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j < n; j++)
                {
                    for (int k = 0; k < n; k++)
                    {
                        c[i, j] += a[i, k] * b[k, j];
                        if (mod > 0)
                        {
                            c[i, j] %= mod;
                        }
                    }
                }
            }

            return new MatrixInt(c, mod);
        }

        public void Print()
        {
            for (int i = 0; i < Size; i++)
            {
                for (int j = 0; j < Size; j++)
                {
                    Console.Write("{0} ", m_Matrix[i, j]);
                }
                Console.WriteLine();
            }
        }
    }

    public static class Permutations
    {
        private static readonly Random m_Random;

        static Permutations()
        {
            m_Random = new Random();
        }

        public static int[] GetRandomPermutation(int n)
        {
            int[] p = new int[n];
            for (int i = 0; i < n; i++)
            {
                p[i] = i;
            }

            for (int i = n - 1; i > 0; i--)
            {
                int j = m_Random.Next(i + 1);
                int tmp = p[i];
                p[i] = p[j];
                p[j] = tmp;
            }

            return p;
        }

        /*public static T[] Shuffle<T>(this T[] array)
        {
            int length = array.Length;
            int[] p = GetRandomPermutation(length);
            T[] result = new T[length];
            for (int i = 0; i < length; i++)
            {
                result[i] = array[p[i]];
            }

            return result;
        }*/

        /*public static T[] ShuffleSort<T>(this T[] array)
        {
            var result = array.Shuffle();
            Array.Sort(result);
            return result;
        }*/

        public static void Shuffle<T>(T[] array)
        {
            var n = array.Count();
            for (int i = n - 1; i > 0; i--)
            {
                int j = m_Random.Next(i + 1);
                T tmp = array[i];
                array[i] = array[j];
                array[j] = tmp;
            }
        }

        public static void ShuffleSort<T>(T[] array)
        {
            Shuffle(array);
            Array.Sort(array);
        }

        public static int[] Next(int[] p)
        {
            int n = p.Length;
            var next = new int[n];
            Array.Copy(p, next, n);

            int k = -1;
            for (int i = n - 1; i > 0; i--)
            {
                if (next[i - 1] < next[i])
                {
                    k = i - 1;
                    break;
                }
            }
            if (k == -1)
            {
                return null;
            }
            for (int i = n - 1; i >= 0; i--)
            {
                if (next[i] > next[k])
                {
                    var tmp = next[i];
                    next[i] = next[k];
                    next[k] = tmp;
                    break;
                }
            }
            for (int i = 1; i <= (n - k - 1) / 2; i++)
            {
                var tmp = next[k + i];
                next[k + i] = next[n - i];
                next[n - i] = tmp;
            }

            return next;
        }
    }

    internal static class Algebra
    {
        public static long Phi(long n)
        {
            long result = n;
            for (long i = 2; i * i <= n; i++)
            {
                if (n % i == 0)
                {
                    while (n % i == 0)
                    {
                        n /= i;
                    }

                    result -= result / i;
                }
            }

            if (n > 1)
            {
                result -= result / n;
            }

            return result;
        }

        public static long BinPower(long a, long n, long mod)
        {
            long result = 1;

            while (n > 0)
            {
                if ((n & 1) != 0)
                {
                    result = (result * a) % mod;
                }

                a = (a * a) % mod;
                n >>= 1;
            }

            return result;
        }

        public static MatrixInt MatrixBinPower(MatrixInt a, long n)
        {
            MatrixInt result = MatrixInt.IdentityMatrix(a.Size, a.Mod);

            while (n > 0)
            {
                if ((n & 1) != 0)
                {
                    result *= a;
                }

                a *= a;
                n >>= 1;
            }

            return result;
        }

        public static long Gcd(long a, long b)
        {
            return b == 0 ? a : Gcd(b, a % b);
        }

        public static long ExtendedGcd(long a, long b, out long x, out long y)
        {
            if (b == 0)
            {
                x = 1;
                y = 0;
                return a;
            }

            long x1;
            long y1;
            long d = ExtendedGcd(b, a % b, out x1, out y1);
            x = y1;
            y = x1 - (a / b) * y1;
            return d;
        }

        public static long Lcm(long a, long b)
        {
            return (a / Gcd(a, b)) * b;
        }

        public static bool[] GetPrimes(int n)
        {
            n = Math.Max(n, 2);
            bool[] prime = new bool[n + 1];
            for (int i = 2; i <= n; i++)
            {
                prime[i] = true;
            }

            for (int i = 2; i * i <= n; i++)
            {
                if (prime[i])
                {
                    if ((long)i * i <= n)
                    {
                        for (int j = i * i; j <= n; j += i)
                        {
                            prime[j] = false;
                        }
                    }
                }
            }

            return prime;
        }

        public static long GetFibonacciNumber(long n, long mod = 0)
        {
            long[,] matrix = new long[,] { { 0, 1 }, { 1, 1 } };

            MatrixInt result = MatrixBinPower(new MatrixInt(matrix, mod), n);

            return result[1, 1];
        }

        public static long[] GetFibonacciSequence(int n)
        {
            long[] result = new long[n];
            result[0] = result[1] = 1;

            for (int i = 2; i < n; i++)
            {
                result[i] = result[i - 1] + result[i - 2];
            }

            return result;
        }

        public static long GetInverseElement(long a, long mod)
        {
            long x, y;
            long g = ExtendedGcd(a, mod, out x, out y);

            if (g != 1)
            {
                return -1;
            }

            return ((x % mod) + mod) % mod;
        }

        public static long[] GetAllInverseElements(long n, long mod)
        {
            long[] result = new long[n];
            result[1] = 1;
            for (int i = 2; i < n; i++)
            {
                result[i] = (mod - (((mod / i) * result[mod % i]) % mod)) % mod;
            }

            return result;
        }

        public static int GetMinimalPrimeDivisor(int n)
        {
            for (int i = 2; i * i <= n; i++)
            {
                if (n % i == 0)
                {
                    return i;
                }
            }

            return n;
        }

        public static long Sqr(long x)
        {
            return x * x;
        }

        public static int SumOfDigits(long x, long baseMod = 10)
        {
            int res = 0;
            while (x > 0)
            {
                res += (int)(x % baseMod);
                x = x / baseMod;
            }
            return res;
        }
    }

    internal static class Reader
    {
        public static void Read<T>(out T v1)
        {
            var values = new T[1];
            Read(values);
            v1 = values[0];
        }

        public static void Read<T>(out T v1, out T v2)
        {
            var values = new T[2];
            Read(values);
            v1 = values[0];
            v2 = values[1];
        }

        public static void Read<T>(out T v1, out T v2, out T v3)
        {
            var values = new T[3];
            Read(values);
            v1 = values[0];
            v2 = values[1];
            v3 = values[2];
        }

        public static void Read<T>(out T v1, out T v2, out T v3, out T v4)
        {
            var values = new T[4];
            Read(values);
            v1 = values[0];
            v2 = values[1];
            v3 = values[2];
            v4 = values[3];
        }

        public static void Read<T>(out T v1, out T v2, out T v3, out T v4, out T v5)
        {
            var values = new T[5];
            Read(values);
            v1 = values[0];
            v2 = values[1];
            v3 = values[2];
            v4 = values[3];
            v5 = values[4];
        }

        public static void Read<T>(T[] values)
        {
            Read(values, values.Length);
        }

        public static void Read<T>(T[] values, int count)
        {
// ReSharper disable PossibleNullReferenceException
            var list = Console.ReadLine().Split();
// ReSharper restore PossibleNullReferenceException

            count = Math.Min(count, list.Length);

            var converter = TypeDescriptor.GetConverter(typeof(T));

            for (int i = 0; i < count; i++)
            {
                values[i] = (T)converter.ConvertFromString(list[i]);
            }
        }

        public static int[] ReadDigits()
        {
            // ReSharper disable AssignNullToNotNullAttribute
            return Console.ReadLine().Select(x => int.Parse(x.ToString(CultureInfo.InvariantCulture))).ToArray();
            // ReSharper restore AssignNullToNotNullAttribute
        }

        public static string ReadLine()
        {
            return Console.ReadLine();
        }
    }

    public interface IGraph
    {
        bool IsOriented { get; set; }

        int Vertices { get; set; }

        IList<int> this[int i] { get; }

        void AddEdge(int u, int v);

        void AddOrientedEdge(int u, int v);

        void AddNotOrientedEdge(int u, int v);
    }

    public class ListGraph : IGraph
    {
        private readonly List<int>[] m_Edges;

        public int Vertices { get; set; }

        public bool IsOriented { get; set; }

        public IList<int> this[int i]
        {
            get
            {
                return this.m_Edges[i];
            }
        }

        public ListGraph(int vertices, bool isOriented = false)
        {
            this.Vertices = vertices;
            this.IsOriented = isOriented;

            this.m_Edges = new List<int>[vertices];

            for (int i = 0; i < vertices; i++)
            {
                this.m_Edges[i] = new List<int>();
            }
        }

        public void AddEdge(int u, int v)
        {
            this.AddOrientedEdge(u, v);
            if (!IsOriented)
            {
                this.AddOrientedEdge(v, u);
            }
        }

        public void AddNotOrientedEdge(int u, int v)
        {
            this.AddOrientedEdge(u, v);
            this.AddOrientedEdge(v, u);
        }

        public void AddOrientedEdge(int first, int second)
        {
            this.m_Edges[first].Add(second);
        }

        public int[] Bfs(int start)
        {
            int[] d = new int[Vertices];
            for (int i = 0; i < Vertices; i++)
            {
                d[i] = -1;
            }

            Queue<int> queue = new Queue<int>();
            queue.Enqueue(start);
            d[start] = 0;

            while (queue.Count > 0)
            {
                int v = queue.Dequeue();
                foreach (int t in this.m_Edges[v].Where(t => d[t] == -1))
                {
                    queue.Enqueue(t);
                    d[t] = d[v] + 1;
                }
            }

            return d;
        }
    }

    internal class SimpleSumTable
    {
        private readonly int[,] m_Sum;

        public SimpleSumTable(int n, int m, int[,] table)
        {
            m_Sum = new int[n + 1,m + 1];

            for (int i = 1; i < n + 1; i++)
            {
                for (int j = 1; j < m + 1; j++)
                {
                    m_Sum[i, j] = m_Sum[i, j - 1] + m_Sum[i - 1, j] - m_Sum[i - 1, j - 1] + table[i - 1, j - 1];
                }
            }
        }

        public int GetSum(int l, int b, int r, int t)
        {
            return m_Sum[r + 1, t + 1] - m_Sum[r + 1, b] - m_Sum[l, t + 1] + m_Sum[l, b];
        }
    }

    internal class SegmentTreeSimpleInt<T>
    {
        public int Size { get; private set; }

        private readonly T[] m_Tree;

        private readonly Func<T, T, T> m_Operation;

        private readonly T m_Null;

        public SegmentTreeSimpleInt(int size, Func<T, T, T> operation, T nullElement, IList<T> array = null)
        {
            this.Size = size;
            this.m_Operation = operation;
            this.m_Null = nullElement;

            m_Tree = new T[4 * size];
            if (array != null)
            {
                this.Build(array, 1, 0, size - 1);
            }
        }

        private void Build(IList<T> array, int v, int tl, int tr)
        {
            if (tl == tr)
            {
                m_Tree[v] = array[tl];
            }
            else
            {
                int tm = (tl + tr) / 2;
                this.Build(array, 2 * v, tl, tm);
                this.Build(array, 2 * v + 1, tm + 1, tr);
                this.CalculateNode(v);
            }
        }

        public T GetSum(int l, int r)
        {
            return GetSum(1, 0, Size - 1, l, r);
        }

        private T GetSum(int v, int tl, int tr, int l, int r)
        {
            if (l > r)
            {
                return m_Null;
            }

            if (l == tl && r == tr)
            {
                return m_Tree[v];
            }

            int tm = (tl + tr) / 2;

            return this.m_Operation(
                GetSum(2 * v, tl, tm, l, Math.Min(r, tm)), GetSum(2 * v + 1, tm + 1, tr, Math.Max(l, tm + 1), r));
        }

        public void Update(int pos, T newValue)
        {
            Update(1, 0, Size - 1, pos, newValue);
        }

        private void Update(int v, int tl, int tr, int pos, T newValue)
        {
            if (tl == tr)
            {
                m_Tree[v] = newValue;
            }
            else
            {
                int tm = (tl + tr) / 2;
                if (pos <= tm)
                {
                    Update(2 * v, tl, tm, pos, newValue);
                }
                else
                {
                    Update(2 * v + 1, tm + 1, tr, pos, newValue);
                }
                this.CalculateNode(v);
            }
        }

        private void CalculateNode(int v)
        {
            m_Tree[v] = this.m_Operation(m_Tree[2 * v], m_Tree[2 * v + 1]);
        }
    }

    internal class Pair<TFirst, TSecond>
    {
        public Pair(TFirst first, TSecond second)
        {
            this.First = first;
            this.Second = second;
        }

        public TFirst First { set; get; }

        public TSecond Second { set; get; }

        protected bool Equals(Pair<TFirst, TSecond> other)
        {
            return EqualityComparer<TFirst>.Default.Equals(this.First, other.First) && EqualityComparer<TSecond>.Default.Equals(this.Second, other.Second);
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj))
            {
                return false;
            }
            if (ReferenceEquals(this, obj))
            {
                return true;
            }
            if (obj.GetType() != this.GetType())
            {
                return false;
            }
            return Equals((Pair<TFirst, TSecond>)obj);
        }

        public override int GetHashCode()
        {
            unchecked
            {
                return (EqualityComparer<TFirst>.Default.GetHashCode(this.First) * 397) ^ EqualityComparer<TSecond>.Default.GetHashCode(this.Second);
            }
        }
    }

    internal class FenwickTreeInt64
    {
        public FenwickTreeInt64(int size)
        {
            this.m_Size = size;
            m_Tree = new long[size];
        }

        public FenwickTreeInt64(int size, IList<long> tree)
            : this(size)
        {
            for (int i = 0; i < size; i++)
            {
                Inc(i, tree[i]);
            }
        }

        public long Sum(int r)
        {
            long res = 0;
            for (; r >= 0; r = (r & (r + 1)) - 1)
            {
                res += m_Tree[r];
            }
            return res;
        }

        public long Sum(int l, int r)
        {
            return Sum(r) - Sum(l - 1);
        }

        public void Inc(int i, long x)
        {
            for (; i < m_Size; i = i | (i + 1))
            {
                m_Tree[i] += x;
            }
        }

        public void Set(int i, long x)
        {
            Inc(i, x - Sum(i, i));
        }

        private readonly int m_Size;

        private readonly long[] m_Tree;
    }

    internal class AccumulativeDictionary<TKey> : Dictionary<TKey, int>
    {
        public new void Add(TKey key, int value = 1)
        {
            if (this.ContainsKey(key))
            {
                base[key] += value;
            }
            else
            {
                base.Add(key, value);
            }
        }

        public new int this[TKey key]
        {
            get
            {
                return this.ContainsKey(key) ? base[key] : 0;
            }
            set
            {
                this.Add(key, value);
            }
        }
    }

    public class PriorityQueue<T>
    {
        public PriorityQueue(Comparison<T> comparison = null)
        {
            if (comparison == null)
            {
                if (typeof(T).GetInterfaces().Any(i => i == typeof(IComparable<T>)))
                {
                    m_Comparison = (a, b) => ((IComparable<T>)a).CompareTo(b);
                }
                else
                {
                    throw new ApplicationException("Add comparer");
                }
            }
            else
            {
                m_Comparison = comparison;
            }
        }

        public int Count { get; private set; }

        public void Enqueue(T item)
        {
            m_List.Add(item);
            m_Indexes.Add(item, this.Count);
            this.Count++;
            Up(this.Count);
        }

        public T Peek()
        {
            return m_List[0];
        }

        public T Dequeue()
        {
            if (this.Count > 0)
            {
                var result = m_List[0];

                Swap(0, this.Count - 1);
                m_Indexes.Remove(m_List[this.Count - 1]);
                m_List.RemoveAt(this.Count - 1);
                this.Count--;
                this.Down(1);

                return result;
            }
            throw new ApplicationException("Couldn't get element from empty queue");
        }

        public void Update(T item)
        {
            int index = m_Indexes[item];
            this.Up(index + 1);
        }

        private readonly List<T> m_List = new List<T>();

        private readonly Dictionary<T, int> m_Indexes = new Dictionary<T, int>();

        private readonly Comparison<T> m_Comparison;

        private void Up(int index)
        {
            while (index > 1 && m_Comparison.Invoke(m_List[index - 1], m_List[index / 2 - 1]) > 0)
            {
                this.Swap(index - 1, index / 2 - 1);

                index = index / 2;
            }
        }

        private void Down(int index)
        {
            while (2 * index <= this.Count && m_Comparison.Invoke(m_List[index - 1], m_List[2 * index - 1]) < 0
                   || 2 * index + 1 <= this.Count && m_Comparison.Invoke(m_List[index - 1], m_List[2 * index]) < 0)
            {
                if (2 * index + 1 > this.Count || m_Comparison.Invoke(m_List[2 * index - 1], m_List[2 * index]) > 0)
                {
                    this.Swap(index - 1, 2 * index - 1);
                    index = 2 * index;
                }
                else
                {
                    this.Swap(index - 1, 2 * index);
                    index = 2 * index + 1;
                }
            }
        }

        private void Swap(int i, int j)
        {
            var tmp = m_List[i];
            m_List[i] = m_List[j];
            m_List[j] = tmp;

            m_Indexes[m_List[i]] = i;
            m_Indexes[m_List[j]] = j;
        }
    }

    public class DisjointSetUnion<T>
    {
        public DisjointSetUnion()
        {
            m_Parent = new Dictionary<T, T>();
            m_Rank = new Dictionary<T, int>();
        }

        public DisjointSetUnion(DisjointSetUnion<T> set)
        {
            m_Parent = new Dictionary<T, T>(set.m_Parent);
            m_Rank = new Dictionary<T, int>(set.m_Rank);
        }

        private readonly Dictionary<T, T> m_Parent;
        private readonly Dictionary<T, int> m_Rank;

        public int GetRank(T x)
        {
            return m_Rank[x];
        }

        public void MakeSet(T x)
        {
            m_Parent[x] = x;
            this.m_Rank[x] = 0;
        }

        public void UnionSets(T x, T y)
        {
            x = this.FindSet(x);
            y = this.FindSet(y);
            if (!x.Equals(y))
            {
                if (m_Rank[x] < m_Rank[y])
                {
                    T t = x;
                    x = y;
                    y = t;
                }
                m_Parent[y] = x;
                if (m_Rank[x] == m_Rank[y])
                {
                    m_Rank[x]++;
                }
            }
        }

        public T FindSet(T x)
        {
            if (x.Equals(m_Parent[x]))
            {
                return x;
            }
            return m_Parent[x] = this.FindSet(m_Parent[x]);
        }
    }

    internal class HamiltonianPathFinder
    {
        public static void Run()
        {
            int n, m;
            Reader.Read(out n, out m);
            List<int>[] a = new List<int>[n];
            for (int i = 0; i < n; i++)
            {
                a[i] = new List<int>();
            }
            for (int i = 0; i < m; i++)
            {
                int x, y;
                Reader.Read(out x, out y);
                a[x].Add(y);
                a[y].Add(x);
            }

            var rnd = new Random();

            bool[] v = new bool[n];
            int[] p = new int[n];
            for (int i = 0; i < n; i++)
            {
                p[i] = -1;
            }
            int first = rnd.Next(n);
            int cur = first;
            v[cur] = true;

            int count = 1;

            while (true)
            {
                var unb = a[cur].Where(u => !v[u]).ToList();
                int d = unb.Count;
                if (d > 0)
                {
                    int next = unb[rnd.Next(d)];
                    v[next] = true;
                    p[cur] = next;
                    cur = next;
                    count++;
                }
                else
                {
                    if (count  == n && a[cur].Contains(first))
                    {
                        p[cur] = first;
                        break;
                    }

                    d = a[cur].Count;
                    int pivot;
                    do
                    {
                        pivot = a[cur][rnd.Next(d)];
                    }
                    while (p[pivot] == cur);

                    int next = p[pivot];

                    int x = next;
                    int y = -1;
                    while (true)
                    {
                        int tmp = p[x];
                        p[x] = y;
                        y = x;
                        x = tmp;
                        if (y == cur)
                        {
                            break;
                        }
                    }
                    p[pivot] = cur;
                    cur = next;
                }
            }

            cur = first;
            do
            {
                Console.Write("{0} ", cur);
                cur = p[cur];
            }
            while (cur != first);
        }

        public static void WriteTest(int n)
        {
            Console.WriteLine("{0} {1}", 2 * n, 2 * (n - 1) + n);
            for (int i = 0; i < n - 1; i++)
            {
                Console.WriteLine("{0} {1}", 2 * i, 2 * i + 2);
                Console.WriteLine("{0} {1}", 2 * i + 1, 2 * i + 3);
                //Console.WriteLine("{0} {1}", 2 * i + 1, 2 * i + 2);
                //Console.WriteLine("{0} {1}", 2 * i, 2 * i + 3);
            }
            for (int i = 0; i < n; i++)
            {
                Console.WriteLine("{0} {1}", 2 * i, 2 * i + 1);
            }
        }
    }

    internal class Backtrack<T> where T : class
    {
        public Backtrack(Func<T, IEnumerable<T>> generator)
        {
            this.m_Generator = generator;
        }

        public Dictionary<T, T> Generate(T startState)
        {
            var result = new Dictionary<T, T>();
            result.Add(startState, null);

            var queue = new Queue<T>();
            queue.Enqueue(startState);

            while (queue.Count > 0)
            {
                var current = queue.Dequeue();
                var next = m_Generator(current);
                foreach (var state in next)
                {
                    if (!result.ContainsKey(state))
                    {
                        result[state] = current;
                        queue.Enqueue(state);
                    }
                }
            }

            return result;
        }

        private Func<T, IEnumerable<T>> m_Generator;
    }

    public static class Utility
    {
        public static readonly int[] sx = new[] { 1, 0, -1, 0 };
        public static readonly int[] sy = new[] { 0, 1, 0, -1 };

        public static PointInt[] GenerateNeighbors(long x, long y)
        {
            var result = new PointInt[4];
            for (int i = 0; i < 4; i++)
            {
                result[i] = new PointInt(x + sx[i], y + sy[i]);
            }
            return result;
        }

        public static PointInt[] GenerateNeighbors(this PointInt p)
        {
            return GenerateNeighbors(p.X, p.Y);
        }

        public static List<PointInt> GenerateNeighborsWithBounds(long x, long y, int n, int m)
        {
            var result = new List<PointInt>(4);
            for (int i = 0; i < 4; i++)
            {
                var nx = x + sx[i];
                var ny = y + sy[i];
                if (0 <= nx && nx < n && 0 <= ny && ny < m)
                {
                    result.Add(new PointInt(nx, ny));
                }
            }
            return result;
        }

        public static List<PointInt> GenerateNeighborsWithBounds(this PointInt p, int n, int m)
        {
            return GenerateNeighborsWithBounds(p.X, p.Y, n, m);
        }
    }

    internal class Program
    {
        private static StreamReader m_InputStream;

        private static StreamWriter m_OutStream;

        private static void OpenFiles()
        {
            m_InputStream = new StreamReader("input.txt"); //File.OpenText("input.txt");
            Console.SetIn(m_InputStream);

            m_OutStream = new StreamWriter("output.txt"); //File.CreateText("output.txt");
            Console.SetOut(m_OutStream);
        }

        private static void CloseFiles()
        {
            m_OutStream.Flush();

            m_InputStream.Dispose();
            m_OutStream.Dispose();
        }

        private static void Main()
        {
            //Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;

           // OpenFiles();

            var mainThread = new Thread(() => new Solution().Solve(), 50 * 1024 * 1024);
            mainThread.Start();
            mainThread.Join();

          //  CloseFiles();
        }
    }

    internal class Solution
    {
        public void Solve()
        {
            int n = 4;
            int[] a = new int[n];
            Reader.Read(a);

            var d = a[1] - a[0];
            var ok = true;
            for (int i = 1; i < n - 1; i++)
            {
                ok = ok && (a[i] + d == a[i + 1]);
            }
            if (ok)
            {
                Console.WriteLine(a[3] + d);
                return;
            }

            ok = true;
            for (int i = 1; i < n - 1; i++)
            {
                ok = ok && (a[i] * a[1] == a[i + 1] * a[0]);
            }
            if (ok && a[0] != 0 && ((a[3] * a[1]) % a[0] == 0))
            {
                Console.WriteLine((a[3] * a[1]) / a[0]);
                return;
            }

            /*if (a[0] % a[1] == 0)
            {
                d = a[0] / a[1];
                ok = true;
                for (int i = 1; i < n - 1; i++)
                {
                    ok = ok && (a[i] == a[i + 1] * d);
                }
                if (ok && (a[3] % d == 0))
                {
                    Console.WriteLine(a[3] / d);
                    return;
                }
            }*/

            Console.WriteLine(42);
        }
    }
}


using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace Math
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            Solve(args);
            writer.Flush();
        }

        private static IEnumerable<int> G()
        {
            yield return 2;
            for (int i = 3;; i += 2)
            {
                yield return i;
            }
        }

        private static void Solve(string[] args)
        {
            int n = Next();
            if (n == 1)
            {
                writer.WriteLine("1 0");
                return;
            }

            var list = new List<int>();
            foreach (int i in G())
            {
                if (i*i > n)
                    break;
                while (n%i == 0)
                {
                    list.Add(i);
                    n /= i;
                }
            }
            if (n > 1)
                list.Add(n);

            var g = list.GroupBy(t => t).Select(t => new {t.Key, cnt = t.Count()}).ToArray();
            int ans = 1;
            foreach (var gg in g)
            {
                ans *= gg.Key;
            }

            int max = g.Max(t => t.cnt);

            int cnt;
            for (int i = 0;; i++)
            {
                if (1 << i >= max)
                {
                    cnt = i;
                    break;
                }
            }
            if (g.Any(t => t.cnt != (1 << cnt)))
                cnt++;

            writer.Write(ans);
            writer.Write(' ');
            writer.WriteLine(cnt);
        }

        private static int Next()
        {
            int c;
            int res = 0;
            do
            {
                c = reader.Read();
                if (c == -1)
                    return res;
            } while (c < '0' || c > '9');
            res = c - '0';
            while (true)
            {
                c = reader.Read();
                if (c < '0' || c > '9')
                    return res;
                res *= 10;
                res += c - '0';
            }
        }
    }
}


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

namespace ConsoleApp10
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] a = Array.ConvertAll(Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries), Convert.ToInt32);
            int p1 = 0; int p2 = 1; int p3 = 2;
            bool OK = false;
            for (; p1 <= 5 ;)
            {
                p3++;
                if (p3 > 5)
                {
                    p3 = 2;
                    p2++;
                }
                if (p2 > 5)
                {
                    p2 = 1;
                    p1++;
                }
                List<int> b = new List<int>(a);
                if (p1 <= 5 && p1 != p2 && p2 != p3 && p1 != p3)
                {
                    b[p1] = 0;
                    b[p2] = 0;
                    b[p3] = 0;
                    if (b.Sum() == a[p1] + a[p2] + a[p3])
                    {
                        OK = true;
                    }
                }
            }
            if (OK)
            {
                Console.WriteLine("YES");
            }
            else
            {
                Console.WriteLine("NO");
            }
        }
    }
}


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

namespace _493D
{
    class Program
    {
        // בתור היריב המרחק יהיה אי-זוגי
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            if (n % 2 == 0)
            {
                Console.WriteLine("white");
                Console.WriteLine("1 2");
            }
            else
                Console.WriteLine("black");

        }
    }
}


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

namespace ConsProg
{
    class Program
    {
        static void Main(string[] args)
        {
            string ticket = Console.ReadLine();
            int min = 10, difference = 0;
            string example = "";
            for (int a = 0; a < 10; a++)
                for (int b = 0; b < 10; b++)
                    for (int c = 0; c < 10; c++)
                        for (int d = 0; d < 10; d++)
                            for (int e = 0; e < 10; e++)
                                for (int f = 0; f < 10; f++)
                                {
                                    example = a.ToString() + b.ToString() + c.ToString() + d.ToString() + e.ToString() + f.ToString();
                                    if (IsHappy(int.Parse(example)))
                                    {
                                        int diff = Difference(ticket, example);
                                        if (min > diff)
                                            min = diff;
                                    }
                                }
            Console.WriteLine(min);
        }
        static bool IsHappy(int ticket)
        {
            if ((ticket % 1000000 - ticket % 100000) / 100000 + (ticket % 100000 - ticket % 10000) / 10000 + (ticket % 10000 - ticket % 1000) / 1000
                == (ticket % 1000 - ticket % 100) / 100 + (ticket % 100 - ticket % 10) / 10 + ticket % 10)
                return true;
            return false;
        }
        static int Difference(string t1, string t2)
        {
            int count = 0;
            for (int i = 0; i < 6; i++)
                if (t1[i] != t2[i])
                    count++;
            return count;
        }
        //static bool IsHappy(string ticket)
        //{
        //    if (int.Parse(ticket[0].ToString()) + int.Parse(ticket[1].ToString()) + int.Parse(ticket[2].ToString())
        //        == int.Parse(ticket[3].ToString()) + int.Parse(ticket[4].ToString()) + int.Parse(ticket[5].ToString()))
        //        return true;
        //    return false;
        //}
    }
}


using System;
using System.Collections.Generic;
using System.Linq;

namespace ALGORITM_CodeForces
{
    class Program
    {
        static void Main()
        {
            string s = Console.ReadLine();
            var n = Convert.ToInt64(s.Split(' ')[0]);
            var k = Convert.ToInt64(s.Split(' ')[1]);

            Console.WriteLine(To(1,n,n,k,n));
            Console.WriteLine();
        }
        static long To(long left,long right,long cur,long y,long x)
        {
            long final;
            long y1=1;
            long mid = left + (right - left) / 2;
            long plus = mid;
            long t = mid;
            while ((t/y)!=0)
            {
                t = mid / (y1=y1*y);
                plus = plus + t;

            }

            if ((mid==left) && (left==right))

                return mid;

            else if (plus < cur)
            {
               final = To(mid+1, right, cur,y,x);
            }
            else
            {

               final=To(left, mid, cur,y,x);

            }
            return final;
        }
    }
}


using System;

namespace Task_C
{
    class Program
    {

        static int check(long n)
        {
            if (n == 2 || n == 5 || n == 7 || n == 8)
                return 1;

            int count = 0;
            long m;

            long g = n / 3;
            while (g > 0)
            {
                if ((n - 3 * g) % 2 != 0)
                {
                    g--;
                    continue;
                }

                m = (n - 3 * g) / 2;

                if (m == 0)
                {
                    g -= 2;
                    continue;
                }

                if (g >= (m * (m - 1))/2)
                    count++;
                else
                    break;

                g -= 2;
            }

            return count;
        }

        static void Main(string[] args)
        {
            Int64 n = Int64.Parse(Console.ReadLine());
            Console.WriteLine(check(n));
        }
    }
}


using System;
using System.Collections.Generic;
using System.Text;

namespace problemB
{
    class Program
    {
        static int getMask(int a)
        {
            int result = 0;
            int coef = 1;
            while (a > 0)
            {
                int m = a % 10;
                if (m == 4 || m == 7)
                {
                    result += (m*coef);
                    coef *= 10;
                }
                a /= 10;
            }
            return result;
        }

        static void Main(string[] args)
        {
            int[] data = Array.ConvertAll<string, int>(Console.ReadLine().Split(), int.Parse);
            int a = data[0], b = data[1];
            int first = a+1;
            int mask=0;
            while (true)
            {
                if ((mask=getMask(first)) == b)
                {
                    Console.WriteLine(first);
                    break;
                }
                first++;
            }
        }
    }
}


using System;

namespace A877
{
    class Program
    {
        static void Main(string[] args)
        {
            var s = Console.ReadLine();
            var c = 0;
            if (s.Contains("Danil") &&
                (s.Contains("Olya") || s.Contains("Slava") || s.Contains("Ann") || s.Contains("Nikita")))
            {
                Console.WriteLine("NO");
                return;
            }
            if (s.Contains("Olya") &&
                (s.Contains("Danil") || s.Contains("Slava") || s.Contains("Ann") || s.Contains("Nikita")))
            {
                Console.WriteLine("NO");
                return;
            }
            if (s.Contains("Slava") &&
                (s.Contains("Olya") || s.Contains("Danil") || s.Contains("Ann") || s.Contains("Nikita")))
            {
                Console.WriteLine("NO");
                return;
            }
            if (s.Contains("Ann") &&
                (s.Contains("Olya") || s.Contains("Slava") || s.Contains("Danil") || s.Contains("Nikita")))
            {
                Console.WriteLine("NO");
                return;
            }
            if (s.Contains("Nikita") &&
                (s.Contains("Olya") || s.Contains("Slava") || s.Contains("Ann") || s.Contains("Danil")))
            {
                Console.WriteLine("NO");
                return;
            }

            if (s.Contains("Danil"))
            {
                for (int i = 0; i < s.Length - 4; i++)
                {
                    if (s[i] == 'D' && s[i + 1] == 'a' && s[i + 2] == 'n' && s[i + 3] == 'i' && s[i + 4] == 'l')
                        c++;
                }

                if (c > 1)
                {
                    Console.WriteLine("NO");
                    return;
                }
            }
            if (s.Contains("Olya"))
            {
                for (int i = 0; i < s.Length - 3; i++)
                {
                    if (s[i] == 'O' && s[i + 1] == 'l' && s[i + 2] == 'y' && s[i + 3] == 'a')
                        c++;
                }

                if (c > 1)
                {
                    Console.WriteLine("NO");
                    return;
                }
            }
            if (s.Contains("Slava"))
            {
                for (int i = 0; i < s.Length - 4; i++)
                {
                    if (s[i] == 'S' && s[i + 1] == 'l' && s[i + 2] == 'a' && s[i + 3] == 'v' && s[i + 4] == 'a')
                        c++;
                }

                if (c > 1)
                {
                    Console.WriteLine("NO");
                    return;
                }
            }
            if (s.Contains("Ann"))
            {
                for (int i = 0; i < s.Length - 2; i++)
                {
                    if (s[i] == 'A' && s[i + 1] == 'n' && s[i + 2] == 'n')
                        c++;
                }

                if (c > 1)
                {
                    Console.WriteLine("NO");
                    return;
                }
            }
            if (s.Contains("Nikita"))
            {
                for (int i = 0; i < s.Length - 5; i++)
                {
                    if (s[i] == 'N' && s[i + 1] == 'i' && s[i + 2] == 'k' && s[i + 3] == 'i' && s[i + 4] == 't' && s[i + 5] == 'a')
                        c++;
                }

                if (c > 1)
                {
                    Console.WriteLine("NO");
                    return;
                }
            }
            if (s.Contains("Danil") ||
                s.Contains("Olya") || s.Contains("Slava") || s.Contains("Ann") || s.Contains("Nikita"))
            {
                Console.WriteLine("YES");
                return;
            }

            Console.WriteLine("NO");
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Xsl;

namespace Codeforces
{
	class Program
	{
		static void Main(string[] args)
		{
			string input1 = Console.ReadLine();
			string input2 = Console.ReadLine();

			//string input3 = Console.ReadLine();
			//string input4 = Console.ReadLine();

			//var inputs1 = input1.Split(new[] { ' ', '}', '{' , ',' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();
			//var inputs2 = input2.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();
			//var inputs3 = input3.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();

			long n = long.Parse(input2);

			var dictionary = new Dictionary<long, long>{ {2, 0}, {3, 0}, { 5, 0 }, { 7, 0 } };
			while (n > 0)
			{
				var rest = n % 10;
				switch (rest)
				{
					case 2:
						dictionary[rest]++;
						break;
					case 3:
						dictionary[2]++;
						dictionary[3]++;
						break;
					case 4:
						dictionary[2] += 3;
						dictionary[3]++;
						break;
					case 5:
						dictionary[2] += 3;
						dictionary[3]++;
						dictionary[5]++;
						break;
					case 6:
						dictionary[2] += 4;
						dictionary[3] += 2;
						dictionary[5]++;
						break;
					case 7:
						dictionary[2] += 4;
						dictionary[3] += 2;
						dictionary[5]++;
						dictionary[7]++;
						break;
					case 8:
						dictionary[2] += 7;
						dictionary[3] += 2;
						dictionary[5]++;
						dictionary[7]++;
						break;
					case 9:
						dictionary[2] += 7;
						dictionary[3] += 4;
						dictionary[5]++;
						dictionary[7]++;
						break;
				}
				n /= 10;
			}

			var builder = new StringBuilder();
			foreach (var key in dictionary.Keys.OrderByDescending(k => k))
			{
				if (dictionary[key] == 0)
				{
					continue;
				}

				while (dictionary[key] > 0)
				{
					switch (key)
					{
						case 2:
							dictionary[key]--;
							break;
						case 3:
							dictionary[2]--;
							dictionary[3]--;
							break;
						case 4:
							dictionary[2] -= 3;
							dictionary[3]--;
							break;
						case 5:
							dictionary[2] -= 3;
							dictionary[3]--;
							dictionary[5]--;
							break;
						case 6:
							dictionary[2] -= 4;
							dictionary[3] -= 2;
							dictionary[5]--;
							break;
						case 7:
							dictionary[2] -= 4;
							dictionary[3] -= 2;
							dictionary[5]--;
							dictionary[7]--;
							break;
						case 8:
							dictionary[2] -= 7;
							dictionary[3] -= 2;
							dictionary[5]--;
							dictionary[7]--;
							break;
						case 9:
							dictionary[2] -= 7;
							dictionary[3] -= 4;
							dictionary[5]--;
							dictionary[7]--;
							break;
					}

					builder.Append(key);
				}
			}

			Console.WriteLine(builder.ToString());
		}

		static long Factorial(long a)
		{
			return a > 1 ? a * Factorial(a - 1) : 1;
		}
	}
}


using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace ACM
{
    class Program
    {
        static int Gcd(int a, int b)
        {
            return b != 0 ? Gcd(b, a % b) : a;
        }

        static int Solve(int n, int m)
        {
            if (m == 0)
            {
                return 1;
            }

            if (m == n)
            {
                return 0;
            }

            m--;
            int length = n - 1;
            int one = 0;
            while (m-- > 0)
            {
                if (length == 0)
                {
                    one--;
                }
                else if (length == 1)
                {
                    length--;
                }
                else if (length == 2)
                {
                    length--;
                }
                else
                {
                    length -= 2;
                    one++;
                }
            }

            if (length > 0)
            {
                one++;
            }

            return one;
        }

        static void Main(string[] args)
        {
            string[] token = Console.ReadLine().Split();
            int n = int.Parse(token[0]);
            int m = int.Parse(token[1]);
            Console.WriteLine(Solve(n, m));
        }
    }
}


using System;

class StartUp
{
    static void Main()
    {
        string input = Console.ReadLine();
        string result = "No";
        for (int i = 2; i < input.Length; i++)
        {
            if ((input[i]!=input[i-1])
                    && (input[i-1]!=input[i-2])
                    && (input[i - 2] != input[i])
                    && (input[i]!= '.')
                    && (input[i-1]!= '.')
                    && (input[i-2]!= '.'))
            {
                result = "Yes";
            }
        }
        Console.WriteLine(result);
    }
}


using System;
using System.Collections.Generic;
using System.Linq;

namespace Testriep
{
    public class Program
    {

        public static void Main(string[] args)
        {
            var line=Console.ReadLine().Split(' ');
            var p = int.Parse(line[0]);
            var h = int.Parse(line[1]);
            if (h % 2 == 0)
            {
                h--;
            }
            while (h > p)
            {
                if (isGood(h,p))
                {
                    Console.WriteLine(h);
                    return;
                }
                h -= 2;
            }
            Console.WriteLine(-1);
            //Console.WriteLine(Console.ReadLine().Split(' ').Select(e => int.Parse(e)).Where(e => e != 0).Distinct().Count());
        }

        static bool isGood(int n,int p)
        {
            int sqrt = (int)(Math.Sqrt((double)n)+1);
            int limit = Math.Min(sqrt, p);
           for(int i = 2; i <= limit; i++)
            {
                if (n % i == 0)
                {
                    return false;
                }
            }
            return true;
        }
}
}


using System;
using System.Linq;

namespace CodeForcesTest.Round278
{
    class FightTheMonster
    {
        public static void Main(string[] args)
        {
            Run();
            //Console.ReadLine();
        }

        private static void Run()
        {
            string input = Console.ReadLine();
            var inputArray = input.Split(new[] {' '}).Select(x => Convert.ToInt32(x)).ToArray();
            int hpY = inputArray[0];
            int atkY = inputArray[1];
            int defY = inputArray[2];
            input = Console.ReadLine();

            inputArray = input.Split(new[] { ' ' }).Select(x => Convert.ToInt32(x)).ToArray();
            int hpM = inputArray[0];
            int atkM = inputArray[1];
            int defM = inputArray[2];

            input = Console.ReadLine();
            inputArray = input.Split(new[] { ' ' }).Select(x => Convert.ToInt32(x)).ToArray();
            int h = inputArray[0];
            int a = inputArray[1];
            int d = inputArray[2];

            int cost = Int32.MaxValue;
            int testA = 0;
            int testD = 0;
            int testH = 0;
            for (int atk = atkY; atk <= 200; atk++)
            {
                if (atk <= defM) continue;

                for (int def = defY; def <= 100; def++)
                {
                    int hp = hpY;
                    double dayM = Math.Ceiling((double)hpM / (atk - defM));
                    double dayY = Math.Ceiling(atkM - def > 0 ? (double)hp / (atkM - def) : Int32.MaxValue);
                    while (dayM >= dayY)
                    {
                        hp++;
                        dayM = Math.Ceiling((double)hpM / (atk - defM));
                        dayY = Math.Ceiling(atkM - def > 0 ? (double)hp / (atkM - def) : Int32.MaxValue);
                    }
                    int tmp = a*(atk-atkY) + d*(def-defY) + h*(hp-hpY);
                    if (tmp < cost)
                    {

                        cost = tmp;
                        testA = atk - atkY;
                        testD = def - defY;
                        testH = hp - hpY;
                    }
                }
            }

            Console.WriteLine(cost);
        }

    }
}


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

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            if (n % 4 == 1)
            {
                Console.WriteLine("0 A");
            }
            else if (n % 4 == 3)
            {
                Console.WriteLine("2 A");
            }
            else if (n % 4 == 2)
            {
                Console.WriteLine("1 B");
            }
            else
            {
                Console.WriteLine("1 A");
            }
        }
    }
}


using System;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Debug = System.Diagnostics.Debug;
using static System.Math;
using System.Runtime.CompilerServices;
using MethodImplOptions = System.Runtime.CompilerServices.MethodImplOptions;
using MethodImplAttribute = System.Runtime.CompilerServices.MethodImplAttribute;

public static class P
{
    public static void Main()
    {
        var n = long.Parse(Console.ReadLine());
        var factors = PrimeFactors(n).Distinct().ToArray();
        if (factors.Length == 1)
        {
            Console.WriteLine(factors[0]);
            return;
        }
        Console.WriteLine(1);
    }
    static IEnumerable<long> PrimeFactors(long n)
    {
        while ((n & 1) == 0)
        {
            n >>= 1;
            yield return 2;
        }
        for (long i = 3; i * i <= n; i += 2)
        {
            while (n % i == 0)
            {
                n /= i;
                yield return i;
            }
        }
        if (n != 1) yield return n;
    }
}


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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            Int64 n = Int64.Parse(Console.ReadLine());
            if (n % 2 == 1)
            {
                Console.Write("1");
            }
            else Console.Write("2");
        }
    }
}


using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;

class Solver
{
    public void Solve()
    {
        var ss = Console.ReadLine().Split(' ');
        int n = int.Parse(ss[0]);
        int m = int.Parse(ss[1]);
        int k = int.Parse(ss[2]);

        int[,][] d = new int[n,m][];
        for (int p = 0; p < n; p++)
        {
            Console.ReadLine();
            for (int i = 0; i < m; i++)
            {
                ss = Console.ReadLine().Split(' ');
                d[p, i] = new int[3];
                d[p,i][0] = int.Parse(ss[0]);
                d[p, i][1] = int.Parse(ss[1]);
                d[p, i][2] = int.Parse(ss[2]);
            }
        }

        int max = 0;
        for (int p1 = 0; p1 < n; p1++)
        {
            for (int p2 = 0; p2 < n; p2++)
            {
                var list = new List<KeyValuePair<int,int>>();
                for (int i = 0; i < m; i++)
                {
                    var kv = new KeyValuePair<int,int>( d[p2,i][1]-d[p1,i][0],i );
                    list.Add(kv);
                }
                list.Sort(delegate(KeyValuePair<int,int>kv1,KeyValuePair<int,int>kv2){
                    return -(kv1.Key-kv2.Key);
                });

                int q = k;
                int prof = 0;
                foreach(var v in list)
                {
                    if (v.Key <= 0)
                        break;
                    if (q == 0)
                        break;
                    int qq = Math.Min(q,d[p1,v.Value][2]);
                    prof+=(v.Key* qq);
                    q -= qq;
                }

                max = Math.Max(max, prof);
            }
        }
        Console.WriteLine(max);
    }

#if !DEBUG
    static void Main(string[] args)
    {
        new Solver().Solve();
    }
#endif
}


using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Numerics;
public class Codeforces
{
    protected static TextReader reader;
    protected static TextWriter writer;
    public static int Gcd(int a, int b)
    {
        if (a < 0)
            a = -a;
        if (b < 0)
            b = -b;
        if (a == 0)
            return b;
        while (b != 0)
        {
            int c = a;
            a = b;
            b = c % b;
        }
        return a;
    }
    static object Solve()
    {
        var a = ReadInt();
        var b = ReadInt();
        if (a == b)
        {
            writer.WriteLine(0);
            return null;
        }
        int ctr = 0, q = 1, q2 = 1;
        var cd = Gcd(a, b);
        if (a != 1 && a != cd)
        {
            q = a / cd;
            if (q % 2 != 0 && q % 3 != 0 && q % 5 != 0)
            {
                writer.WriteLine(-1);
                return null;
            }
            while (q % 5 == 0)
            {
                q /= 5;
                ctr++;
            }
            while (q % 3 == 0)
            {
                q /= 3;
                ctr++;
            }
            while (q % 2 == 0)
            {
                q /= 2;
                ctr++;
            }
        }
        if (b != 1 && b != cd)
        {
            q2 = b / cd;
            if (q2 % 2 != 0 && q2 % 3 != 0 && q2 % 5 != 0)
            {
                writer.WriteLine(-1);
                return null;
            }
            while (q2 % 5 == 0)
            {
                q2 /= 5;
                ctr++;
            }
            while (q2 % 3 == 0)
            {
                q2 /= 3;
                ctr++;
            }
            while (q2 % 2 == 0)
            {
                q2 /= 2;
                ctr++;
            }
        }
        if (q == q2)
        {
            Console.WriteLine(ctr);
        }
        else
        {
            Console.WriteLine(-1);
        }
        return null;
    }
    static void Main()
    {
        reader = new StreamReader(Console.OpenStandardInput(1024 * 10), System.Text.Encoding.ASCII, false, 1024 * 10);
        writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), System.Text.Encoding.ASCII, 1024 * 10);
        try
        {
            object result = Solve();
            if (result != null)
                writer.WriteLine(result);
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex);
            throw;
        }
        reader.Close();
        writer.Close();
    }
    #region Read / Write

    private static Queue<string> currentLineTokens = new Queue<string>();

    private static string[] ReadAndSplitLine()
    {
        return reader.ReadLine().Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
    }

    public static string ReadToken()
    {
        while (currentLineTokens.Count == 0)
            currentLineTokens = new Queue<string>(ReadAndSplitLine());
        return currentLineTokens.Dequeue();
    }

    public static int ReadInt()
    {
        return int.Parse(ReadToken());
    }

    public static long ReadLong()
    {
        return long.Parse(ReadToken());
    }

    public static double ReadDouble()
    {
        return double.Parse(ReadToken(), CultureInfo.InvariantCulture);
    }

    public static int[] ReadIntArray()
    {
        return ReadAndSplitLine().Select(int.Parse).ToArray();
    }

    public static long[] ReadLongArray()
    {
        return ReadAndSplitLine().Select(long.Parse).ToArray();
    }

    public static double[] ReadDoubleArray()
    {
        return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();
    }
    public static int[][] ReadIntMatrix(int numberOfRows)
    {
        int[][] matrix = new int[numberOfRows][];
        for (int i = 0; i < numberOfRows; i++)
            matrix[i] = ReadIntArray();
        return matrix;
    }
    public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)
    {
        int[][] matrix = ReadIntMatrix(numberOfRows);
        int[][] ret = new int[matrix[0].Length][];
        for (int i = 0; i < ret.Length; i++)
        {
            ret[i] = new int[numberOfRows];
            for (int j = 0; j < numberOfRows; j++)
                ret[i][j] = matrix[j][i];
        }
        return ret;
    }

    public static string[] ReadLines(int quantity)
    {
        string[] lines = new string[quantity];
        for (int i = 0; i < quantity; i++)
            lines[i] = reader.ReadLine().Trim();
        return lines;
    }
    public static void WriteArray<T>(IEnumerable<T> array)
    {
        writer.WriteLine(string.Join(" ", array));
    }

    public static void Write<T>(params T[] array)
    {
        WriteArray(array);
    }

    public static void WriteLines<T>(IEnumerable<T> array)
    {
        foreach (var a in array)
            writer.WriteLine(a);
    }
    #endregion
}


using System;
using System.Linq;
namespace _873A
{
    internal class Program
    {
        public static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');
            int n = int.Parse(input[0]), k = int.Parse(input[1]), x = int.Parse(input[2]);
            int[] a = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
            Array.Sort(a, (f, s) => s.CompareTo(f));
            for (int i = 0; i < k; i++)
                a[i] = x;
            Console.WriteLine(a.Sum());
        }
    }
}