using System;
using System.Linq;
using System.IO;
using System.Collections.Generic;
// Powered by caide (code generator, tester, and library code inliner)

class Solution {
    public void solve(TextReader input, TextWriter output) {
        string s1 = input.ReadLine();
        string s2 = input.ReadLine();
        int index = 0;
        foreach(char c in s2)
        {
            if(c == s1[index])
            {
                index++;
            }
        }
        output.Write(index + 1);
    }
}

class CaideConstants {
    public const string InputFile = null;
    public const string OutputFile = null;
}
public class Program {
    public static void Main(string[] args) {
        Solution solution = new Solution();
        using (System.IO.TextReader input =
                CaideConstants.InputFile == null ? System.Console.In :
                        new System.IO.StreamReader(CaideConstants.InputFile))
        using (System.IO.TextWriter output =
                CaideConstants.OutputFile == null ? System.Console.Out:
                        new System.IO.StreamWriter(CaideConstants.OutputFile))

            solution.solve(input, output);
    }
}


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

namespace A.Theatre_Square
{
    class Program
    {
        static int sq2(int k)
        {
            return (1 << k) - 1;
        }

        static void Main(string[] args)
        {
            string[] data = Console.ReadLine().Trim().Split(' ');
            int n = Int32.Parse(data[0]);
            int h = Int32.Parse(data[1]);
            Int64[,] f=new Int64[36,36];
            f[0, 0] = 1;
            f[1, 1] = 1;
            for (int i = 2; i <= n; i++)
            {
                for (int j = i; j <= n; j++)
                {
                    for (int k = 0; k <= j - 1; k++)
                    {
                        for (int l = (int)Math.Ceiling(Math.Log(k + 1, 2)); l <= k; l++)
                        {
                            for (int r = (int)Math.Ceiling(Math.Log(j - k, 2)); r <= j - k - 1; r++)
                            {
                                if((l==i-1 || r==i-1)&&(l<i && r<i))
                                    f[i, j] += f[l, k] * f[r, j - k - 1];
                            }
                        }
                    }
                }
            }
            Int64 result = 0;
            for (int i = h; i <= n; i++)
            {
                result += f[i, n];
            }
            Console.WriteLine(result);
            Console.ReadKey();
        }
    }

}


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

namespace Codeforces_249_2
{
    class Program
    {
        static string solve(string s, int k)
        {
            if (k < 1 || s.Length < 2) return s;
            int m = 0;
            for (int i = 1; i < s.Length && i <= k; ++i)
                if (s[m] < s[i]) m = i;
            return s[m] + solve(s.Substring(0, m) + s.Substring(m + 1), k - m);
        }
        static void Main(string[] args)
        {
            string[] S = Console.ReadLine().Split(' ');
            Console.WriteLine( solve( S[0], int.Parse(S[1]) ) );
        }
    }
}


using System;
using System.IO;

class CFB
{
    static int a, b;
    static string d, aA;
    static void DocThongSo()
    {
        string S = Console.ReadLine();
        //a.deb
        string[] M = S.Split(new char[] { '.' });
        string[] E = M[1].Split(new char[] { 'e' });
        a = int.Parse(M[0]);
        aA = M[0];
        b = int.Parse(E[1]);
        d = E[0];
    }
    static void Main(string[] agrs)
    {
        DocThongSo();
        string kq = aA;
        if (b > 0 && b<d.Length)
        {
            for (int i = 0; i < b; i++)
            {
                kq = kq + d[i];
            }
            kq = kq + ".";
            for (int i = b; i < d.Length; i++)
            {
                kq = kq + d[i];
            }
        }
        else if (b == 0 && d != "0")
        {
            kq = kq + "." + d;
        }
        else if(b==d.Length)
        {
            kq = kq + d;
        }
        else if (b > d.Length)
        {
            int L = b-d.Length;
            kq = kq + d;
            for (int i = 1; i <= L; i++)
            {
                kq = kq + "0";
            }
        }
        else if (a == b && a == 0)
        {
            kq = "0";
        }
        Console.WriteLine(kq);
    }
}


using System;

class Program {
	public static void Main() {
#if DVORAK
		Console.SetIn(new System.IO.StreamReader("..\\..\\in.txt"));
#endif
		String[] mon = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" };

		Console.WriteLine(mon[(Array.IndexOf(mon, Console.ReadLine()) + Int32.Parse(Console.ReadLine())) % mon.Length]);
	}
}


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

namespace Codeforces
{
	internal class Template
	{
		private Dictionary<Tuple<long, long, long>, long> dp;

		private void Solve()
		{
			dp = new Dictionary<Tuple<long, long, long>, long>();

			var n = cin.NextLong();
			var l = cin.NextLong();
			var r = cin.NextLong();

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

			var count = Count(n, l-1, r-1);
			Console.WriteLine(count);
		}

		private long Count(long n, long l, long r)
		{
			if (n == 1)
			{
				return 1;
			}

			if (dp.ContainsKey(Tuple.Create(n, l, r)))
			{
				return dp[Tuple.Create(n, l, r)];
			}

			var idx = 0;
			var nn = n;
			while (nn > 1)
			{
				idx++;
				nn/=2;
			}
			var len = 1L;
			for (var i = 0; i < idx; i++)
			{
				len *= 2;
				len++;
			}
			var middle = len/2;
			var sum = 0L;
			if (l <= middle && r >= middle)
			{
				sum += n%2;
				if (l < middle)
				{
					sum += Count(n/2, l, middle - 1);
				}
				if (r > middle)
				{
					sum += Count(n/2, 0, r - middle - 1);
				}
			}
			else if (l < middle)
			{
				sum += Count(n/2, l, r);
			}
			else
			{
				sum += Count(n/2, l - middle - 1, r - middle - 1);
			}
			dp[Tuple.Create(n, l, r)] = sum;
			return sum;
		}

		private static readonly Scanner cin = new Scanner();

		private static void Main()
		{
#if DEBUG
			var inputText = File.ReadAllText(@"..\..\input.txt");
			var testCases = inputText.Split(new[] { "input" }, StringSplitOptions.RemoveEmptyEntries);
			var consoleOut = Console.Out;
			for (var i = 0; i < testCases.Length; i++)
			{
				var parts = testCases[i].Split(new[] { "output" }, StringSplitOptions.RemoveEmptyEntries);
				Console.SetIn(new StringReader(parts[0].Trim()));
				var stringWriter = new StringWriter();
				Console.SetOut(stringWriter);
				var sw = Stopwatch.StartNew();
				new Template().Solve();
				sw.Stop();
				var output = stringWriter.ToString();

				Console.SetOut(consoleOut);
				var color = ConsoleColor.Green;
				var status = "Passed";
				if (parts[1].Trim() != output.Trim())
				{
					color = ConsoleColor.Red;
					status = "Failed";
				}
				Console.ForegroundColor = color;
				Console.WriteLine("Test {0} {1} in {2}ms", i + 1, status, sw.ElapsedMilliseconds);
			}
			Console.ReadLine();
			Console.ReadKey();
#else
			new Template().Solve();
			Console.ReadLine();
#endif
		}
	}

	internal class Scanner
	{
		private string[] s = new string[0];
		private int i;
		private readonly char[] cs = { ' ' };

		public string NextString()
		{
			if (i < s.Length) return s[i++];
			var line = Console.ReadLine() ?? string.Empty;
			s = line.Split(cs, StringSplitOptions.RemoveEmptyEntries);
			i = 1;
			return s.First();
		}

		public double NextDouble()
		{
			return double.Parse(NextString());
		}

		public int NextInt()
		{
			return int.Parse(NextString());
		}

		public long NextLong()
		{
			return long.Parse(NextString());
		}
	}
}


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

namespace RocketB
{
    class Program
    {

        private class Bid
        {
            public int Index;
            public bool Left;
            public int Value;
            public double[] WinRate;
        }

        static void Main(string[] args)
        {
            string str = Console.ReadLine();
            int n = 0;
            int.TryParse(str, out n);

            var R = new int[n];
            var L = new int[n];
            int min = 100000;
            int max = 0;
            for(int i = 0; i < n; i++)
            {
                str = Console.ReadLine();
                var strs = str.Split(' ');
                int l = 0;
                int r = 0;
                int.TryParse(strs[0], out l);
                int.TryParse(strs[1], out r);
                L[i] = l;
                R[i] = r;
                if(l < min) min = l;
                if(r > max) max = r;
            }

            double expected = 0d;

            //var debug = new double[max + 1];
            //double weightSum =0;
            for (int price = min; price <= max; price++)
            {

                double weight = 0;
                double exactlyOne = 0;
                double less = 1d;
                double notMore = 1d;
                for(int i =0; i < n; i++)
                {
                    var ri = R[i];
                    var li = L[i];
                    var di = ri - li + 1;
                    double imoreprob;
                    double iNotMoreProb;
                    double here = 0d;
                    if(li > price)
                    {
                        less = 0;
                        notMore = 0;
                        imoreprob = 1;
                        iNotMoreProb = 0;
                    }
                    else
                        if(ri < price)
                        {
                            imoreprob = 0;
                            iNotMoreProb = 1;
                            //less *= 1;
                            //notMore *= 1;
                            continue;
                        }
                        else
                        {
                            imoreprob = (ri - price) / (double)di;
                            notMore *=  (price - li + 1) / (double)di;
                            less *= (price - li)  / (double)di;
                            here = 1 / (double)di;
                        }

                    double allNotMore = 1d;
                    double allLess = 1d;

                    for(int j =0; j <n; j++)
                    {
                        if (j == i) continue;
                        var rj = R[j];
                        var lj = L[j];
                        var dj = rj - lj + 1;

                        if(lj > price)
                        {
                            allNotMore = allLess = 0;
                        }
                        else
                        if(rj < price)
                        {
                            //allNotMore *=1 ; allLess *= 1;
                        }
                        else
                        {
                            allNotMore *= (price - lj + 1) /(double)dj;
                            allLess *= (price - lj) / (double)dj;
                        }
                    }

                    weight += imoreprob * (allNotMore - allLess);
                    exactlyOne += here * allLess;
                    //weight += here *
                }
                weight += (notMore - less - exactlyOne);//2 or more here
                //debug[price] = weight;
               // weightSum += weight;
                expected += price * weight;
            }

            Console.WriteLine((expected).ToString("F10", CultureInfo.InvariantCulture)); ;

        }
    }
}


using System;
using System.IO;
using System.Text;

namespace The_Wall__medium_
{
    internal class Program
    {
        private const int mod = 1000003;
        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 long[] fact;
        private static long[] fact1;

        private static void Main(string[] args)
        {
            int n = Next();
            int c = Next();

            InitFact(n + c + 1);
            long ans = (GetCFact(n + c, c) - 1 + mod)%mod;

            writer.WriteLine(ans);
            writer.Flush();
        }

        private static void InitFact(int n)
        {
            fact = new long[n];
            fact1 = new long[n];

            fact[0] = 1;

            for (int i = 1; i < fact.Length; i++)
            {
                fact[i] = (fact[i - 1]*i)%mod;
            }
            fact1[n - 1] = Pow(fact[n - 1], mod - 2);
            for (int i = fact1.Length - 2; i >= 0; i--)
            {
                fact1[i] = (fact1[i + 1]*(i + 1))%mod;
            }
        }

        private static long Pow(long a, int k)
        {
            long r = 1;
            while (k > 0)
            {
                if ((k & 1) == 1)
                {
                    r = (r*a)%mod;
                }
                a = (a*a)%mod;
                k >>= 1;
            }
            return r;
        }

        private static long GetCFact(int n, int k)
        {
            return (((fact[n]*fact1[k])%mod)*fact1[n - k])%mod;
        }

        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.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 s1 = 0;
			var s2 = 0;
			var p = false;
			for (var i = 0; i < n; ++i)
			{
				var l = getList();
				s1 += l[0];
				s2 += l[1];
				if (l[0]%2 != l[1]%2)
					p = true;
			}
			if (s1%2 == s2%2)
			{
				if (s1 % 2 == 0)
					Console.WriteLine(0);
				else
				{
					if (p)
						Console.WriteLine(1);
					else
					{
						Console.WriteLine(-1);
					}
				}
			}
			else
			{
				Console.WriteLine(-1);
			}
			/*			input.Close();
			output.Close();*/
		}
	}
}


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

namespace ProgrammingContest.Codeforces.Round91 {
    class C {
        static List<int> num = new List<int>();
        static void gen(long x, int n) {
            if (x <= n) {
                if(x != 0)
                    num.Add((int)x);
                gen(x * 10 + 4, n);
                gen(x * 10 + 7, n);
            }
        }

        static long fact(long n) { long res = 1; while (n > 1) res *= n--; return res; }

        static int n;
        static List<int> val = new List<int>();
        static int dfs(int pos, long k) {
            if (pos > n) return 0;
            int rest = n - pos,
                res = 0;
            for (int i = 0; i < val.Count; i++) {
                if (val[i] == -1) continue;
                if (k < fact(rest)) {
                    if (num.Contains(val[i]) && num.Contains(pos)) {
                        res = 1;
                    }
                    //Console.WriteLine("dfs: {0} {1}", pos, val[i]);
                    val[i] = -1;
                    return res + dfs(pos + 1, k);
                }
                k -= fact(rest);
            }
            throw new Exception();
        }

        static void Main() {
            var xs = Array.ConvertAll<string, int>(Console.ReadLine().Split(' '), int.Parse);
            n = xs[0];
            int k = xs[1]-1;

            for (int v = k, i = 1; i <= n && v != 0; i++) {
                v /= i;
                if (i == n && v != 0) {
                    Console.WriteLine(-1);
                    return;
                }
            }

            gen(0, n);
            num.Sort();
            for (long v = 1, i = 1; i <= n; i++) {
                v *= i;
                if (k < v) {
                    int res = 0;
                    int m = (int)(n - i);
                    int id = -1;
                    //Console.WriteLine("dfs: {0} {1}", m, res);
                    for (int j = 0; j < num.Count; j++) {
                        if (num[j] > m) {
                            res += j;
                            id = j;
                            break;
                        }
                        if (j == num.Count - 1) {
                            Console.WriteLine(num.Count);
                            return;
                        }
                    }
                    //Console.WriteLine("dfs: {0} {1}", m, res);
                    for (int j = m; j < n; j++) {
                        val.Add(j + 1);
                    }
                    Console.WriteLine(dfs(m+1, k) + res);
                    return;
                }
            }
        }
    }
}


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

namespace Coding
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] integersInput = Console.ReadLine().Split();

            int n = int.Parse(integersInput[0]);
            int m = int.Parse(integersInput[1]);
            int k = int.Parse(integersInput[2]);

            if (n - m <= 0 && n - k <= 0)
            {
                Console.WriteLine("Yes");
            } else
            {
                Console.WriteLine("No");
            }
        }
    }
}


using System;

namespace CSCA
{
    public class Program
    {
        public static void Main(string[] args)
        {
            string[] scan = new string[2];
            int n, k, timeLimit;
            scan = Console.ReadLine().Split(' ');
            n = Convert.ToInt32(scan[0]);
            k = Convert.ToInt32(scan[1]);
            timeLimit = 240 - k;
            int time = 0, ans = 0;
            for (int i = 1; i <= n; i++)
            {
                if (time + i * 5 <= timeLimit)
                {
                    time += i * 5;
                    ans++;
                }
                else break;
            }
            Console.WriteLine(ans);
            return;
        }
    }
}


using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading;

// (づ°ω°)づﾐe★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜
public class Solution
{
    const int MOD = 1000000007;

    public void Solve()
    {
        for (int tt = ReadInt(); tt > 0; tt--)
        {
            int n = ReadInt();
            int m = ReadInt();

            long ans = 1;
            for (int i = 0; i < m; i++)
                ans = ans * n % MOD;

            Write(ans);
        }
    }

    #region Main

    protected static TextReader reader;
    protected static TextWriter writer;
    static void Main()
    {
#if DEBUGLOCAL
        reader = new StreamReader("..\\..\\input.txt");
        //reader = new StreamReader(Console.OpenStandardInput());
        writer = Console.Out;
        //writer = new StreamWriter("..\\..\\output.txt");
#else
        reader = new StreamReader(Console.OpenStandardInput());
        writer = new StreamWriter(Console.OpenStandardOutput());
        //reader = new StreamReader("ysys.in");
        //writer = new StreamWriter("output.txt");
#endif
        try
        {
            new Solution().Solve();
            //var thread = new Thread(new Solution().Solve, 1024 * 1024 * 128);
            //thread.Start();
            //thread.Join();
        }
        catch (Exception ex)
        {
#if DEBUGLOCAL
            Console.WriteLine(ex);
#else
            throw;
#endif
        }
        reader.Close();
        writer.Close();
    }

    #endregion

    #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(params object[] array) { WriteArray(array); }
    public static void WriteLines<T>(IEnumerable<T> array) { foreach (var a in array) writer.WriteLine(a); }
    private class SDictionary<TKey, TValue> : Dictionary<TKey, TValue>
    {
        public new TValue this[TKey key]
        {
            get { return ContainsKey(key) ? base[key] : default(TValue); }
            set { base[key] = value; }
        }
    }
    private static T[] Init<T>(int size) where T : new() { var ret = new T[size]; for (int i = 0; i < size; i++) ret[i] = new T(); return ret; }
    #endregion
}


using System;
using System.Collections.Generic;
using System.Linq;
using CompLib.Util;

public class Program
{
    int N;
    long M;
    long[] A;
    public void Solve()
    {
        var sc = new Scanner();
        N = sc.NextInt();
        M = sc.NextInt();
        A = sc.LongArray();

        /*
         * Aからいくつか選んで Mod Mが最大になるようにする
         */

        var left = Calc(0, N / 2);
        var right = Calc(N / 2, N);
        long ans = ((left.Last() + right.Last()) % M);
        foreach (int i in left)
        {
            // i + right[j] がM未満最大
            //
            int ok = 0;
            int ng = right.Count;
            while(ng - ok > 1)
            {
                int mid = (ok + ng) / 2;
                if (i + right[mid] < M) ok = mid;
                else ng = mid;
            }
            ans = Math.Max(ans, i + right[ok]);
        }

        Console.WriteLine(ans);
    }

    List<long> Calc(int b, int e)
    {
        var ls = new List<long>();
        ls.Add(0);

        for (int i = b; i < e; i++)
        {
            int len = ls.Count;
            for (int j = 0; j < len; j++)
            {
                ls.Add((ls[j] + A[i]) % M);
            }
        }

        var result = new List<long>();
        ls.Sort();
        for (int i = 0; i < ls.Count; i++)
        {
            if (i == 0 || ls[i - 1] != ls[i])
            {
                result.Add(ls[i]);
            }
        }

        return result;
    }

    public static void Main(string[] args) => new Program().Solve();
}

namespace CompLib.Util
{
    using System;
    using System.Linq;

    class Scanner
    {
        private string[] _line;
        private int _index;
        private const char Separator = ' ';

        public Scanner()
        {
            _line = new string[0];
            _index = 0;
        }

        public string Next()
        {
            if (_index >= _line.Length)
            {
                string s;
                do
                {
                    s = Console.ReadLine();
                } while (s.Length == 0);

                _line = s.Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public string ReadLine()
        {
            _index = _line.Length;
            return Console.ReadLine();
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            string s = Console.ReadLine();
            _line = s.Length == 0 ? new string[0] : s.Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}


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

#if DEBUG
using System.Diagnostics;
#endif

namespace CompetitiveProgramming
{
    class Program
    {
        static bool s_IsMultipleTestCases = false;
        static void Main(string[] args)
        {
#if DEBUG
            s_IsMultipleTestCases = true;
            var streamReader = new StreamReader("../../input.txt", Encoding.ASCII, false, 32768);
            var streamWriter = new StreamWriter("../../output.txt", false, Encoding.ASCII, 32768);
            var timer = new Stopwatch();
#else
            var streamReader = new StreamReader(Console.OpenStandardInput(32768), Encoding.ASCII, false, 32768);
            var streamWriter = new StreamWriter(Console.OpenStandardOutput(32768), Encoding.ASCII, 32768);
#endif
            var reader = new InputReader(streamReader);

            var numberOfTest = 1;
            if (s_IsMultipleTestCases)
            {
                numberOfTest = reader.NextInt();
            }
            for (var testNumber = 1; testNumber <= numberOfTest; ++testNumber)
            {
#if DEBUG
                timer.Start();
#endif
                Task solver = new Task();
                solver.Solve(testNumber, reader, streamWriter);
#if DEBUG
                streamWriter.WriteLine("Eslapsed Time: " + timer.ElapsedMilliseconds + " ms\n");
                timer.Reset();
#endif
            }
            streamReader.Close();
            streamWriter.Close();
        }
    }

    class Task
    {
        const long MOD = 1000000007;
        const int MAXN = 20002;
        long ans = 0;
        string res = "NO";
        long BASE = 31;

        public void Solve(int testNumber, InputReader reader, StreamWriter writer)
        {
            var n = reader.NextInt();
            var c = reader.NextInt();
            var p = reader.NIS(n);
            var t = reader.NIS(n);
            var limark = 0;
            var radewoosh = 0;
            var x = 0;
            for (int i = 0; i < n; i++)
            {
                x += t[i];
                limark += Max(0, p[i] - c * x);
            }

            x = 0;
            for (int i = n - 1; i >= 0; i--)
            {
                x += t[i];
                radewoosh += Max(0, p[i] - c * x);
            }

            if(limark == radewoosh)
            {
                res = "Tie";
            }else if(limark > radewoosh)
            {
                res = "Limak";
            }
            else
            {
                res = "Radewoosh";
            }
            writer.WriteLine(res);
        }

        #region Utilities
        private string ConvertArrayToString(int[] arrs)
        {
            var sb = new StringBuilder();
            foreach (var item in arrs)
            {
                sb.Append(item);
                sb.Append("\n");
            }
            return sb.ToString();
        }

        private string ConvertArrayToString(long[] arrs)
        {
            var sb = new StringBuilder();
            foreach (var item in arrs)
            {
                sb.Append(item);
                sb.Append("\n");
            }
            return sb.ToString();
        }

        private string ConvertDoubleToString(double x)
        {
            return x.ToString(CultureInfo.InvariantCulture);
        }

        private int Max(int a, int b)
        {
            return Math.Max(a, b);
        }

        private int Min(int a, int b)
        {
            return Math.Min(a, b);
        }

        private long Max(long a, long b)
        {
            return Math.Max(a, b);
        }

        private long Min(long a, long b)
        {
            return Math.Min(a, b);
        }

        private long GCD(long a, long b)
        {
            return a > 0 ? b : GCD(b, a % b);
        }

        private int GCD(int a, int b)
        {
            return a > 0 ? b : GCD(b, a % b);
        }

        #endregion
    }

    class InputReader
    {
        private char[] _inbuf;
        private int _lenbuf = 0, _ptrbuf = 0;
        private StreamReader _reader;

        public InputReader(StreamReader reader)
        {
            _reader = reader;
            _inbuf = new char[1024];
            _lenbuf = 0;
            _ptrbuf = 0;
        }

        private int ReadByte()
        {
            if (_lenbuf == -1)
                throw new Exception();
            if (_ptrbuf >= _lenbuf)
            {
                _ptrbuf = 0;
                try
                {
                    _lenbuf = _reader.Read(_inbuf, 0, 1024);
                }
                catch (IOException e)
                {
                    throw e;
                }
                if (_lenbuf <= 0)
                    return -1;
            }
            return _inbuf[_ptrbuf++];
        }

        private bool IsSpaceChar(int c)
        {
            return !(c >= 33 && c <= 126);
        }

        private int Skip()
        {
            int b;
            while ((b = ReadByte()) != -1 && IsSpaceChar(b)) ;
            return b;
        }

        public int NextInt()
        {
            int num = 0, b;
            var minus = false;
            while ((b = ReadByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
            if (b == '-')
            {
                minus = true;
                b = ReadByte();
            }

            while (true)
            {
                if (b >= '0' && b <= '9')
                {
                    num = num * 10 + (b - '0');
                }
                else
                {
                    return minus ? -num : num;
                }
                b = ReadByte();
            }
        }

        public long NextLong()
        {
            long num = 0, b;
            var minus = false;
            while ((b = ReadByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
            if (b == '-')
            {
                minus = true;
                b = ReadByte();
            }

            while (true)
            {
                if (b >= '0' && b <= '9')
                {
                    num = num * 10 + (b - '0');
                }
                else
                {
                    return minus ? -num : num;
                }
                b = ReadByte();
            }
        }

        public string Next()
        {
            var b = Skip();
            var sb = new StringBuilder();
            while (!(IsSpaceChar(b)))
            {
                sb.Append((char)b);
                b = ReadByte();
            }
            return sb.ToString();
        }

        public double NextDouble()
        {
            return double.Parse(Next(), CultureInfo.InvariantCulture);
        }

        public int[] NIS(int n)
        {
            var arrs = new int[n];
            for (int i = 0; i < n; i++)
            {
                arrs[i] = NextInt();
            }
            return arrs;
        }

        public long[] NLS(int n)
        {
            var arrs = new long[n];
            for (int i = 0; i < n; i++)
            {
                arrs[i] = NextLong();
            }
            return arrs;
        }
    }

}


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

namespace ConsoleApplication6
{
    class Program
    {
        static void Main()
        {
            string input = Console.ReadLine();
            int n = int.Parse(input.Split(' ')[0]);
            int k = int.Parse(input.Split(' ')[1]);

            Dictionary<int, int> cipa = new Dictionary<int, int>();
            string pizda = Console.ReadLine();
            for (int i = 0; i < n; i++)
            {
                int val = int.Parse(pizda.Split(' ')[i]);
                if (!cipa.ContainsValue(val))
                {
                    cipa.Add(i + 1, val);
                }
            }

            if (cipa.Count() >= k)
            {
                Console.WriteLine("YES");
                Console.Write(string.Join(" ", cipa.Select(x => x.Key).Take(k).ToArray()));
            }
            else
            {
                Console.WriteLine("NO");
            }
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Runtime.CompilerServices;
using System.Text;
using System.Diagnostics;
using System.Numerics;
using static System.Console;
using static System.Convert;
using static System.Math;
using static Template;
using Pi = Pair<int, int>;

class Solver
{
    public void Solve(Scanner sc)
    {
        int N, K;
        sc.Make(out N, out K);
        ModInt.Build(K + 1);
        var F = new ModInt[K + 2];
        for (int i = 1; i < K + 2; i++)
        {
            F[i] = ModInt.Pow(i, K) + F[i - 1];
        }
        if (N <= K + 1) Fail(F[N]);
        WriteLine(LagrangePolynomial(F, N));
    }
    public ModInt LagrangePolynomial(ModInt[] Y,int T,int a=0,int d = 1)
    {
        if (T < Y.Length) return Y[T];
        ModInt[] left = new ModInt[Y.Length], right = new ModInt[Y.Length];
        left[0] = right[Y.Length - 1] = 1;
        for (int i = 0; i < Y.Length-1; i++)
        {
            left[i + 1] = left[i] * (T - a - d * i);
        }
        for (int i = Y.Length - 2; i >= 0; i--)
        {
            right[i] = right[i + 1] * (T - a - d * (i + 1));
        }
        ModInt res = 0;
        for (int i = 0; i < Y.Length; i++)
        {
            ModInt r = Y[i] * left[i] * right[i] * ModInt.FacInv(i) * ModInt.FacInv(Y.Length - i - 1);
            if ((Y.Length - i - 1) % 2 == 0) res += r;
            else res -= r;
        }
        return res;
    }
}

public struct ModInt
{
    public const long MOD = (int)1e9 + 7;
    //public const long MOD = 998244353;
    public long Value { get; set; }
    public ModInt(long n = 0) { Value = n; }
    private static ModInt[] fac;//i!
    private static ModInt[] inv;//1/i
    private static ModInt[] facinv;//1/(i!)
    public override string ToString() => Value.ToString();
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static ModInt operator +(ModInt l, ModInt r)
    {
        l.Value += r.Value;
        if (l.Value >= MOD) l.Value -= MOD;
        return l;
    }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static ModInt operator -(ModInt l, ModInt r)
    {
        l.Value -= r.Value;
        if (l.Value < 0) l.Value += MOD;
        return l;
    }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static ModInt operator *(ModInt l, ModInt r) => new ModInt(l.Value * r.Value % MOD);
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static ModInt operator /(ModInt l, ModInt r) => l * Pow(r, MOD - 2);
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static implicit operator long(ModInt l) => l.Value;
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static implicit operator ModInt(long n)
    {
        n %= MOD; if (n < 0) n += MOD;
        return new ModInt(n);
    }

    public static ModInt Pow(ModInt m, long n)
    {
        if (n == 0) return 1;
        if (n % 2 == 0) return Pow(m * m, n >> 1);
        else return Pow(m * m, n >> 1) * m;
    }

    public static void Build(int n)
    {
        fac = new ModInt[n + 1];
        facinv = new ModInt[n + 1];
        inv = new ModInt[n + 1];
        inv[1] = 1;
        fac[0] = fac[1] = 1;
        facinv[0] = facinv[1] = 1;
        for (var i = 2; i <= n; i++)
        {
            fac[i] = fac[i - 1] * i;
            inv[i] = MOD - inv[MOD % i] * (MOD / i);
            facinv[i] = facinv[i - 1] * inv[i];
        }
    }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static ModInt Fac(ModInt n) => fac[n];
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static ModInt Inv(ModInt n) => inv[n];
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static ModInt FacInv(ModInt n) => facinv[n];
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static ModInt Comb(ModInt n, ModInt r)
    {
        if (n < r) return 0;
        if (n == r) return 1;
        var calc = fac[n];
        calc = calc * facinv[r];
        calc = calc * facinv[n - r];
        return calc;
    }
}
#region Template
public static class Template
{
    static void Main(string[] args)
    {
        Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });
        new Solver().Solve(new Scanner());
        Console.Out.Flush();
    }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static bool chmin<T>(ref T a, T b) where T : IComparable<T> { if (a.CompareTo(b) > 0) { a = b; return true; } return false; }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static bool chmax<T>(ref T a, T b) where T : IComparable<T> { if (a.CompareTo(b) < 0) { a = b; return true; } return false; }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static void swap<T>(ref T a, ref T b) { var t = b; b = a; a = t; }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static void swap<T>(this IList<T> A, int i, int j) { var t = A[i]; A[i] = A[j]; A[j] = t; }
    public static T[] Create<T>(int n, Func<T> f) { var rt = new T[n]; for (var i = 0; i < rt.Length; ++i) rt[i] = f(); return rt; }
    public static T[] Create<T>(int n, Func<int, T> f) { var rt = new T[n]; for (var i = 0; i < rt.Length; ++i) rt[i] = f(i); return rt; }
    public static IEnumerable<T> Shuffle<T>(this IEnumerable<T> A) => A.OrderBy(v => Guid.NewGuid());
    public static int CompareTo<T>(this T[] A, T[] B, Comparison<T> cmp = null) { cmp = cmp ?? Comparer<T>.Default.Compare; for (var i = 0; i < Min(A.Length, B.Length); i++) { int c = cmp(A[i], B[i]); if (c > 0) return 1; else if (c < 0) return -1; } if (A.Length == B.Length) return 0; if (A.Length > B.Length) return 1; else return -1; }
    public static int MaxElement<T>(this IList<T> A, Comparison<T> cmp = null) { cmp = cmp ?? Comparer<T>.Default.Compare; T max = A[0]; int rt = 0; for (int i = 1; i < A.Count; i++) if (cmp(max, A[i]) < 0) { max = A[i]; rt = i; } return rt; }
    public static T PopBack<T>(this List<T> A) { var v = A[A.Count - 1]; A.RemoveAt(A.Count - 1); return v; }
    public static void Fail<T>(T s) { Console.WriteLine(s); Console.Out.Close(); Environment.Exit(0); }
}
public class Scanner
{
    public string Str => Console.ReadLine().Trim();
    public int Int => int.Parse(Str);
    public long Long => long.Parse(Str);
    public double Double => double.Parse(Str);
    public int[] ArrInt => Str.Split(' ').Select(int.Parse).ToArray();
    public long[] ArrLong => Str.Split(' ').Select(long.Parse).ToArray();
    public char[][] Grid(int n) => Create(n, () => Str.ToCharArray());
    public int[] ArrInt1D(int n) => Create(n, () => Int);
    public long[] ArrLong1D(int n) => Create(n, () => Long);
    public int[][] ArrInt2D(int n) => Create(n, () => ArrInt);
    public long[][] ArrLong2D(int n) => Create(n, () => ArrLong);
    private Queue<string> q = new Queue<string>();
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public T Next<T>() { if (q.Count == 0) foreach (var item in Str.Split(' ')) q.Enqueue(item); return (T)Convert.ChangeType(q.Dequeue(), typeof(T)); }
    public void Make<T1>(out T1 v1) => v1 = Next<T1>();
    public void Make<T1, T2>(out T1 v1, out T2 v2) { v1 = Next<T1>(); v2 = Next<T2>(); }
    public void Make<T1, T2, T3>(out T1 v1, out T2 v2, out T3 v3) { Make(out v1, out v2); v3 = Next<T3>(); }
    public void Make<T1, T2, T3, T4>(out T1 v1, out T2 v2, out T3 v3, out T4 v4) { Make(out v1, out v2, out v3); v4 = Next<T4>(); }
    public void Make<T1, T2, T3, T4, T5>(out T1 v1, out T2 v2, out T3 v3, out T4 v4, out T5 v5) { Make(out v1, out v2, out v3, out v4); v5 = Next<T5>(); }
    public void Make<T1, T2, T3, T4, T5, T6>(out T1 v1, out T2 v2, out T3 v3, out T4 v4, out T5 v5, out T6 v6) { Make(out v1, out v2, out v3, out v4, out v5); v6 = Next<T6>(); }
    //public (T1, T2) Make<T1, T2>() { Make(out T1 v1, out T2 v2); return (v1, v2); }
    //public (T1, T2, T3) Make<T1, T2, T3>() { Make(out T1 v1, out T2 v2, out T3 v3); return (v1, v2, v3); }
    //public (T1, T2, T3, T4) Make<T1, T2, T3, T4>() { Make(out T1 v1, out T2 v2, out T3 v3, out T4 v4); return (v1, v2, v3, v4); }
}
public class Pair<T1, T2> : IComparable<Pair<T1, T2>>
{
    public T1 v1;
    public T2 v2;
    public Pair() { }
    public Pair(T1 v1, T2 v2)
    { this.v1 = v1; this.v2 = v2; }

    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public int CompareTo(Pair<T1, T2> p)
    {
        var c = Comparer<T1>.Default.Compare(v1, p.v1);
        if (c == 0)
            c = Comparer<T2>.Default.Compare(v2, p.v2);
        return c;
    }
    public override string ToString() => $"{v1.ToString()} {v2.ToString()}";
    public void Deconstruct(out T1 a, out T2 b) { a = v1; b = v2; }
}

public class Pair<T1, T2, T3> : Pair<T1, T2>, IComparable<Pair<T1, T2, T3>>
{
    public T3 v3;
    public Pair() : base() { }
    public Pair(T1 v1, T2 v2, T3 v3) : base(v1, v2)
    { this.v3 = v3; }

    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public int CompareTo(Pair<T1, T2, T3> p)
    {
        var c = base.CompareTo(p);
        if (c == 0)
            c = Comparer<T3>.Default.Compare(v3, p.v3);
        return c;
    }
    public override string ToString() => $"{base.ToString()} {v3.ToString()}";
    public void Deconstruct(out T1 a, out T2 b, out T3 c) { Deconstruct(out a, out b); c = v3; }
}
#endregion


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

namespace Mail.Ru_Cup_2018_Round_1
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            int[] Input = s.Split(' ').Select(n => Convert.ToInt32(n)).ToArray();
            int TCurrElev = Input[4] * (Subtract(Input[0], Input[2]));
            int TCurrVist = Input[4] * (Subtract(Input[0], Input[1]));
            int TElevator = TCurrElev + TCurrVist + (Input[5] * 3);
            int TStairs = Input[3] * (Subtract(Input[0], Input[1]));
            if (TElevator <= TStairs)
            {
                Console.WriteLine("YES");
            }
            else
            {
                Console.WriteLine("NO");
            }
        }

        static int Subtract(int x,int y)
        {
            return (Math.Abs(x - y));
        }
    }
}


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

// (づ°ω°)づﾐ★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜
public class Solver
{
    const int MAX = 4000;
    const int MOD = 1000000007;

    void Solve()
    {
        // OEIS A005493
        // a(n+1) = 1 + sum { j=1, n, (1+binomial(n, j))*a(j) }

        var c = new int[MAX + 1, MAX + 1];
        for (int i = 1; i <= MAX; i++)
            for (int j = 1; j <= i; j++)
            {
                if (i == j)
                    c[i, j] = 1;
                else if (j == 1)
                    c[i, j] = i;
                else
                    c[i, j] = (c[i - 1, j] + c[i - 1, j - 1]) % MOD;
            }

        var a = new long[MAX + 1];
        a[1] = 1;
        a[2] = 3;
        a[3] = 10;
        for (int i = 4; i <= MAX; i++)
        {
            a[i] = 1;
            for (int j = 1; j < i; j++)
                a[i] = (a[i] + (1 + c[i - 1, j]) * a[j]) % MOD;
        }

        Write(a[ReadInt()]);
    }

    #region Main

    protected static TextReader reader;
    protected static TextWriter writer;
    static void Main()
    {
#if DEBUG
        reader = new StreamReader("..\\..\\input.txt");
        //reader = new StreamReader(Console.OpenStandardInput());
        writer = Console.Out;
        //writer = new StreamWriter("..\\..\\output.txt");
#else
        reader = new StreamReader(Console.OpenStandardInput());
        writer = new StreamWriter(Console.OpenStandardOutput());
        //reader = new StreamReader("hull.in");
        //writer = new StreamWriter("hull.out");
#endif
        try
        {
            //            var thread = new Thread(new Solver().Solve, 1024 * 1024 * 128);
            //            thread.Start();
            //            thread.Join();
            checked
            {
                new Solver().Solve();
            }
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex);
#if DEBUG
#else
            throw;
#endif
        }
        reader.Close();
        writer.Close();
    }

    #endregion

    #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(params object[] array) { WriteArray(array); }
    public static void WriteLines<T>(IEnumerable<T> array) { foreach (var a in array)writer.WriteLine(a); }
    private class SDictionary<TKey, TValue> : Dictionary<TKey, TValue>
    {
        public new TValue this[TKey key]
        {
            get { return ContainsKey(key) ? base[key] : default(TValue); }
            set { base[key] = value; }
        }
    }
    private static T[] Init<T>(int size) where T : new() { var ret = new T[size]; for (int i = 0; i < size; i++)ret[i] = new T(); return ret; }
    #endregion
}


using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Security.Policy;

public static class Ex
{
    public static bool IsNullOrEmpty(this string s) { return string.IsNullOrEmpty(s); }
    public static void yesno(this bool b) => Console.WriteLine(b ? "yes" : "no");
    public static void YesNo(this bool b) => Console.WriteLine(b ? "Yes" : "No");
    public static void YESNO(this bool b) => Console.WriteLine(b ? "YES" : "NO");
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    //public static bool Chmax<T>(ref this T a, T b) where T : struct, IComparable<T>
    //{
    //    if (b.CompareTo(a) > 0) { a = b; return true; }
    //    else return false;
    //}
    //[MethodImpl(MethodImplOptions.AggressiveInlining)]
    //public static bool Chmin<T>(ref this T a, T b) where T : struct, IComparable<T>
    //{
    //    if (b.CompareTo(a) < 0) { a = b; return true; }
    //    else return false;
    //}

    public static List<string> FastSort(this List<string> s) { s.Sort(StringComparer.OrdinalIgnoreCase); return s.ToList(); }

    public static int PopCount(this uint bits)
    {
        bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555);
        bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333);
        bits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f);
        bits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff);
        return (int)((bits & 0x0000ffff) + (bits >> 16 & 0x0000ffff));
    }
}

partial class Program
{
    string GetStr() { return Console.ReadLine().Trim(); }
    char GetChar() { return Console.ReadLine().Trim()[0]; }
    int GetInt() { return int.Parse(Console.ReadLine().Trim()); }
    long GetLong() { return long.Parse(Console.ReadLine().Trim()); }
    double GetDouble() { return double.Parse(Console.ReadLine().Trim()); }
    string[] GetStrArray() { return Console.ReadLine().Trim().Split(' '); }
    string[][] GetStrArray(int N)
    {
        var res = new string[N][];
        for (int i = 0; i < N; i++) res[i] = Console.ReadLine().Trim().Split(' ');
        return res;
    }
    int[] GetIntArray() { return Console.ReadLine().Trim().Split(' ').Select(int.Parse).ToArray(); }
    int[][] GetIntArray(int N)
    {
        var res = new int[N][];
        for (int i = 0; i < N; i++) res[i] = Console.ReadLine().Trim().Split(' ').Select(int.Parse).ToArray();
        return res;
    }
    public long[] GetLongArray() { return Console.ReadLine().Trim().Split(' ').Select(long.Parse).ToArray(); }
    long[][] GetLongArray(int N)
    {
        var res = new long[N][];
        for (int i = 0; i < N; i++) res[i] = Console.ReadLine().Trim().Split(' ').Select(long.Parse).ToArray();
        return res;
    }
    char[] GetCharArray() { return Console.ReadLine().Trim().Split(' ').Select(char.Parse).ToArray(); }
    double[] GetDoubleArray() { return Console.ReadLine().Trim().Split(' ').Select(double.Parse).ToArray(); }
    double[][] GetDoubleArray(int N)
    {
        var res = new double[N][];
        for (int i = 0; i < N; i++) res[i] = Console.ReadLine().Trim().Split(' ').Select(double.Parse).ToArray();
        return res;
    }
    char[][] GetGrid(int H)
    {
        var res = new char[H][];
        for (int i = 0; i < H; i++) res[i] = Console.ReadLine().Trim().ToCharArray();
        return res;
    }
    T[] CreateArray<T>(int N, T value)
    {
        var res = new T[N];
        for (int i = 0; i < N; i++) res[i] = value;
        return res;
    }
    T[][] CreateArray<T>(int H, int W, T value)
    {
        var res = new T[H][];
        for (int i = 0; i < H; i++)
        {
            res[i] = new T[W];
            for (int j = 0; j < W; j++) res[i][j] = value;
        }
        return res;
    }
    T[][][] CreateArray<T>(int H, int W, int R, T value)
    {
        var res = new T[H][][];
        for (int i = 0; i < H; i++)
        {
            res[i] = new T[W][];
            for (int j = 0; j < W; j++)
            {
                res[i][j] = new T[R];
                for (int k = 0; k < R; k++) res[i][j][k] = value;
            }
        }
        return res;
    }

    Dictionary<int, List<int>> GetUnweightedAdjacencyList(int N, int M, bool isDirected, bool isNode_0indexed)
    {
        var dic = new Dictionary<int, List<int>>();
        foreach (var e in Enumerable.Range(0, N)) { dic.Add(e, new List<int>()); }
        for (int i = 0; i < M; i++)
        {
            var input = GetIntArray();
            var a = isNode_0indexed ? input[0] : input[0] - 1;
            var b = isNode_0indexed ? input[1] : input[1] - 1;
            dic[a].Add(b);
            if (isDirected == false) dic[b].Add(a);
        }
        return dic;
    }
    //Dictionary<int, List<(int node, long cost)>> GetWeightedAdjacencyList(int N, int M, bool isDirected, bool isNode_0indexed)
    //{
    //    var dic = new Dictionary<int, List<(int, long)>>();
    //    foreach (var e in Enumerable.Range(0, N)) { dic.Add(e, new List<(int, long)>()); }
    //    for (int i = 0; i < M; i++)
    //    {
    //        var input = GetIntArray();
    //        var a = isNode_0indexed ? input[0] : input[0] - 1;
    //        var b = isNode_0indexed ? input[1] : input[1] - 1;
    //        var c = input[2];
    //        dic[a].Add((b, c));
    //        if (isDirected == false) dic[b].Add((a, c));
    //    }
    //    return dic;
    //}

    bool eq<T, U>() => typeof(T).Equals(typeof(U));
    T ct<T, U>(U a) => (T)Convert.ChangeType(a, typeof(T));
    T cv<T>(string s) => eq<T, int>() ? ct<T, int>(int.Parse(s))
                       : eq<T, long>() ? ct<T, long>(long.Parse(s))
                       : eq<T, double>() ? ct<T, double>(double.Parse(s))
                       : eq<T, char>() ? ct<T, char>(s[0])
                                         : ct<T, string>(s);
    void Multi<T>(out T a) => a = cv<T>(GetStr());
    void Multi<T, U>(out T a, out U b)
    {
        var ar = GetStrArray(); a = cv<T>(ar[0]); b = cv<U>(ar[1]);
    }
    void Multi<T, U, V>(out T a, out U b, out V c)
    {
        var ar = GetStrArray(); a = cv<T>(ar[0]); b = cv<U>(ar[1]); c = cv<V>(ar[2]);
    }
    void Multi<T, U, V, W>(out T a, out U b, out V c, out W d)
    {
        var ar = GetStrArray(); a = cv<T>(ar[0]); b = cv<U>(ar[1]); c = cv<V>(ar[2]); d = cv<W>(ar[3]);
    }
    void Multi<T, U, V, W, X>(out T a, out U b, out V c, out W d, out X e)
    {
        var ar = GetStrArray(); a = cv<T>(ar[0]); b = cv<U>(ar[1]); c = cv<V>(ar[2]); d = cv<W>(ar[3]); e = cv<X>(ar[4]);
    }
    void Multi<T, U, V, W, X, Y>(out T a, out U b, out V c, out W d, out X e, out Y f)
    {
        var ar = GetStrArray(); a = cv<T>(ar[0]); b = cv<U>(ar[1]); c = cv<V>(ar[2]); d = cv<W>(ar[3]); e = cv<X>(ar[4]); f = cv<Y>(ar[5]);
    }

    void Output<T>(T t) => Console.WriteLine(t);
    void Output<T>(IList<T> ls) => Console.WriteLine(string.Join(" ", ls));
    void Debug<T>(IList<IList<T>> ls)
    {
        foreach (var l in ls)
            foreach (var s in l)
                Console.WriteLine(s);
    }

    void Swap<T>(ref T a, ref T b) { T temp = a; a = b; b = temp; }

    int[] dx = new int[] { 1, 0, -1, 0, 1, -1, -1, 1 };
    int[] dy = new int[] { 0, 1, 0, -1, 1, 1, -1, -1 };
    long mod = 1000000007;
}

partial class Program
{
    static void Main()
    {
        //Console.SetIn(new StreamReader(Console.OpenStandardInput(8192)));
        //Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });
        new Program().Solve();
        //Console.Out.Flush();
        Console.Read();
    }

    public void Solve()
    {
        long N = GetLong();
        long M = N / 2;
        long b = 1;
        for (long i = 1; i < M; i++) b *= i;
        long B = 1;
        for (long i = M + 1; i <= N; i++) B *= i;
        Output(B / M /2* b);
    }

}


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

namespace Trailing_Loves
{
    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)
        {
            writer.WriteLine(Solve(args));
            writer.Flush();
        }

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

        private static long Solve(string[] args)
        {
            long n = Next();
            long b = Next();

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

            long ans = long.MaxValue;
            foreach (var p in list.GroupBy(t => t).Select(t => new {t.Key, cnt = t.Count()}))
            {
                ans = Math.Min(ans, Count(n, p.Key)/p.cnt);
            }

            return ans;
        }

        private static long Count(long n, long max)
        {
            long ans = 0;
            for (long i = max;;)
            {
                ans += n/i;
                if (n/max >= i)
                    i *= max;
                else
                    break;
            }
            return ans;
        }

        private static long Next()
        {
            int c;
            long 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.Text;

namespace KolyaAndTandemRepeat
{
    partial class KolyaAndTandemRepeat
    {
        static void Main(string[] args)
        {
            StringBuilder s;
            int add, max = 0, current;

            s = new StringBuilder(ReadLine());
            add = NextInt();

            s.Append('*', add);

            for (int i = 0; i < s.Length; i++)
            {
                for (int j = i + 1; j < s.Length; j++)
                {
                    current = 0;

                    for (int k = i, l = j; k < j && ((j + (j - i)) - 1 < s.Length); k++, l++)
                    {
                        if (s[k] != s[l] && s[l] != '*')
                            break;

                        current++;
                    }

                    if (current > max)
                        max = current;
                }
            }

            Console.WriteLine(max * 2);
        }
    }

    partial class KolyaAndTandemRepeat
    {
        static string[] tokens = new string[0];
        static int cur_token = 0;

        static void ReadArray(char sep)
        {
            cur_token = 0;
            tokens = Console.ReadLine().Split(sep);
        }

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

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

        static int NextInt()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return int.Parse(tokens[cur_token++]);
        }

        static long NextLong()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return long.Parse(tokens[cur_token++]);
        }

        static double NextDouble()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return double.Parse(tokens[cur_token++]);
        }

        static decimal NextDecimal()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return decimal.Parse(tokens[cur_token++]);
        }

        static string NextToken()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return tokens[cur_token++];
        }

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


using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
using static System.Convert;
using static System.Math;
//using Debug;
//using static System.Globalization.CultureInfo;
//using Edge = Pair<long, int>;
using System.Text;
class Program
{
    static void Main(string[] args)
    {
        Solve();
        //WriteLine(Solve());
    }
    static void Solve()
    {
        var nkd = Input.ar;
        var dp = new long[nkd[0] + 1, 2];
        dp[0, 0] = 1;
        for (var i = 1; i <= nkd[0]; i++)
                for (var h = i - 1; h >= 0; h--)
                {
                    if (h >= Max(0, i - nkd[2] + 1))
                        dp[i, 0] = (dp[i, 0] + dp[h, 0]) % Input.MOD;
                    if (h >= Max(0, i - nkd[2] + 1))
                        dp[i, 1] = (dp[i, 1] + dp[h, 1]) % Input.MOD;
                    else if(h>=i-nkd[1])
                        dp[i, 1] = (dp[i, 1] + dp[h, 0] + dp[h, 1]) % Input.MOD;
                }
        WriteLine(dp[nkd[0], 1]);
    }
}

public class Input
{
    public static string read => ReadLine().Trim();
    public static int[] ar => read.Split(' ').Select(int.Parse).ToArray();
    public  static int num => ToInt32(read);
    public static long[] arL => read.Split(' ').Select(long.Parse).ToArray();
    public  static long numL => ToInt64(read);
    public static char[][] gred(int h)
        => Enumerable.Repeat(0, h).Select(_ => read.ToCharArray()).ToArray();
    public static int[][] ar2D(int num)
        => Enumerable.Repeat(0, num).Select(_ => ar).ToArray();
    public static long[][] arL2D(int num)
        => Enumerable.Repeat(0, num).Select(_ => arL).ToArray();
    public static T getValue<T>(string g)
    {
        var t = typeof(T);
        if (t == typeof(int))
            return (T)(object)int.Parse(g);
        if (t == typeof(long))
            return (T)(object)long.Parse(g);
        if (t == typeof(string))
            return (T)(object)g;
        if (t == typeof(char))
            return (T)(object)char.Parse(g);
        if (t == typeof(double))
            return (T)(object)double.Parse(g);
        if (t == typeof(bool))
            return (T)(object)bool.Parse(g);
        return default(T);
    }
    public const long Inf = (long)1e18;
    public const double eps = 1e-6;
    public  const string Alfa = "abcdefghijklmnopqrstuvwxyz";
    public  const int MOD = 1000000007;
}


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

namespace _426A
{
    class Program
    {
        static void Main(string[] args)
        {
            string header = Console.ReadLine();
            int n=int.Parse(header.Split()[0]);
            int s = int.Parse(header.Split()[1]);

            int sum = 0, max=0;
            string[] str = Console.ReadLine().Split();

            for (int i = 0; i < n; i++)
            {
                if (int.Parse(str[i]) > max)
                    max = int.Parse(str[i]);

                sum += int.Parse(str[i]);
            }

            sum -= max;

            Console.Write(sum<=s ? "YES" : "NO");
        }
    }
}


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

class Scanner
{
    private readonly char Separator = ' ';
    private int Index = 0;
    private string[] Line = new string[0];
    public string Next()
    {
        if (Index >= Line.Length)
        {
            Line = Console.ReadLine().Split(Separator);
            Index = 0;
        }
        var ret = Line[Index];
        Index++;
        return ret;
    }

    public int NextInt()
    {
        return int.Parse(Next());
    }

    public long NextLong()
    {
        return long.Parse(Next());
    }

    public string[] StringArray()
    {
        Line = Console.ReadLine().Split(Separator);
        Index = Line.Length;
        return Line;
    }

    public int[] IntArray()
    {
        var l = StringArray();
        var res = new int[l.Length];
        for (int i = 0; i < l.Length; i++)
        {
            res[i] = int.Parse(l[i]);
        }
        return res;
    }

    public long[] LongArray()
    {
        var l = StringArray();
        var res = new long[l.Length];
        for (int i = 0; i < l.Length; i++)
        {
            res[i] = long.Parse(l[i]);
        }
        return res;
    }
}

class Program
{
    private string Zero = "What are you doing at the end of the world? Are you busy? Will you save us?";
    private string AddA = "What are you doing while sending \"";
    private string AddB = "\"? Are you busy? Will you send \"";
    private string AddC = "\"?";
    private int Q;
    private int[] N;
    private long[] K;
    private long[] Length;
    private void Scan()
    {
        var sc = new Scanner();
        Q = sc.NextInt();
        N = new int[Q];
        K = new long[Q];
        for (int i = 0; i < Q; i++)
        {
            N[i] = sc.NextInt();
            K[i] = sc.NextLong();
        }
    }

    private void CalcLength()
    {
        Length = new long[100001];
        Length[0] = Zero.Length;
        for (int i = 1; i <= 100000; i++)
        {
            Length[i] = Math.Min((Length[i - 1] * 2) + AddA.Length + AddB.Length + AddC.Length, (long)1e18 + 1);
        }
    }

    private char Func(int i, long index)
    {
        if (Length[i] <= index)
        {
            return '.';
        }
        if (i == 0)
        {
            return Zero[(int)index];
        }
        long a, b, c, d, e;
        a = AddA.Length;
        b = a + Length[i - 1];
        c = b + AddB.Length;
        d = c + Length[i - 1];
        e = d + AddC.Length;
        if (index < a)
        {
            return AddA[(int)index];
        }
        if (a <= index && index < b)
        {
            return Func(i - 1, index - a);
        }
        if (b <= index && index < c)
        {
            return AddB[(int)(index - b)];
        }
        if (c <= index && index < d)
        {
            return Func(i - 1, index - c);
        }
        if (d <= index && index < e)
        {
            return AddC[(int)(index - d)];
        }
        return '.';
    }

    public void Solve()
    {
        Scan();
        CalcLength();
        var ans = "";
        for (int i = 0; i < Q; i++)
        {
            ans += Func(N[i], K[i] - 1);
        }
        Console.WriteLine(ans);
    }

    static void Main(string[] args)
    {
        new Program().Solve();
    }
}


using System;
using System.IO;
using System.Linq;

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

        int x = int.Parse(input[0]);
        int y = int.Parse(input[1]);

        int xVector = x / Math.Abs(x);
        int yVector = y / Math.Abs(y);

        int length = Math.Abs(x) + Math.Abs(y);

        int x1 = length * xVector;
        int y2 = length * yVector;

        if (x1 < 0)
        {
            OutputXY(x1, 0);
            OutputXY(0, y2);
        }
        else
        {
            OutputXY(0, y2);
            OutputXY(x1, 0);
        }
    }

    private static void OutputXY(int x, int y)
    {
        Console.Write("{0} {1} ", x, y);
    }
}


using System;
using System.CodeDom;
using System.Collections.Generic;
using System.ComponentModel.Design.Serialization;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading;

namespace Codeforces
{
    class Program : IDisposable
    {
        private static readonly TextReader textReader = new StreamReader(Console.OpenStandardInput());
        private static readonly TextWriter textWriter = new StreamWriter(Console.OpenStandardOutput());

        private void Solve()
        {
            var n = int.Parse(Console.ReadLine());
            var arr1 = Console.ReadLine().Split(' ').Select(int.Parse).ToList();
            var arr2 = Console.ReadLine().Split(' ').Select(int.Parse).ToList();

            var set = new HashSet<int>();
            foreach (var el in arr1)
            {
                set.Add(el);
            }

            foreach (var el in arr2)
            {
                set.Add(el);
            }

            arr1.Sort();
            arr2.Sort();

            int cnt = 0;
            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j < n; j++)
                {
                    var val = arr1[i] ^ arr2[j];
                    if (set.Contains(val))
                        cnt++;
                }
            }
            if(cnt%2==0)
                Console.WriteLine("Karen");
            else
                Console.WriteLine("Koyomi");
        }

        int BinarySearch(int[] arr, int q)
        {
            var l = 0;
            var r = arr.Length - 1;
            //int med = -1;
            while (l <= r)
            {
                var med = l + (r - l) / 2;
                if (arr[med] == q)
                {
                    return med;
                }
                if (q < arr[med])
                {
                    r = med - 1;
                }
                else
                {
                    l = med + 1;
                }
            }
            return -1;
        }

        static void Main(string[] args)
        {
            var p = new Program();
            p.Solve();
            //Console.ReadLine();
            //p.Dispose();
            //////////////////////////////
        }

        #region Helpers

        private static int ReadInt()
        {
            return int.Parse(textReader.ReadLine());
        }

        private static long ReadLong()
        {
            return long.Parse(textReader.ReadLine());
        }

        private static int[] ReadIntArray()
        {
            return textReader.ReadLine().Split(' ').Select(int.Parse).ToArray();
        }
        #endregion

        public void Dispose()
        {
            textReader.Close();
            textWriter.Close();
        }
    }

    //class Trie
    //{
    //    public TrieNode root;

    //    public Trie()
    //    {
    //        root = new TrieNode();
    //    }

    //    public void Insert(string s)
    //    {
    //        var current = root;
    //        for (int i = 0; i < s.Length; i++)
    //        {
    //            var ch = s[i];
    //            if (!current.Children.ContainsKey(ch))
    //                current.Children.Add(ch, new TrieNode());
    //            current = current.Children[ch];
    //        }
    //        current.IsEnd = true;
    //    }

    //    public bool Search(string word)
    //    {
    //        var current = root;
    //        for (int i = 0; i < word.Length; i++)
    //        {
    //            var ch = word[i];
    //            if (!current.Children.ContainsKey(ch))
    //                return false;
    //            current = current.Children[ch];
    //        }
    //        return current.IsEnd;
    //    }
    //}

    //class TrieNode
    //{
    //    public Dictionary<char, TrieNode> Children { get; set; }
    //    public bool IsEnd { get; set; }

    //    public TrieNode()
    //    {
    //        Children = new Dictionary<char, TrieNode>();
    //        IsEnd = false;
    //    }

    //}
}


using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
class Solution
{

    static bool IsPossible(int[] months, int[] data)
    {
        var idxs = data.Select((s, i) => s == months[0] ? i : -1).Where(s => s >= 0);
        foreach (var idx in idxs)
        {
            var found = true;
            for (var i = 0; i < months.Length; i++)
            {
                if (months[i] != data[(idx + i) % data.Length])
                {
                    found = false;
                    break;
                }
            }
            if (found)
                return true;
        }
        return false;
    }

    static void Main(String[] args)
    {
        var leap = new[] {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
        var nonLeap = new[] { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

        var leapAndNonLeap = new int[24];
        leap.CopyTo(leapAndNonLeap, 0);
        nonLeap.CopyTo(leapAndNonLeap, 12);

        var nonLeapAndNonLeap = new int[24];
        nonLeap.CopyTo(nonLeapAndNonLeap, 0);
        nonLeap.CopyTo(nonLeapAndNonLeap, 12);

        var n = Convert.ToInt32(Console.ReadLine());
        var tempA = Console.ReadLine().Split(' ');
        var months = Array.ConvertAll(tempA, int.Parse);

        var possible = IsPossible(months, leapAndNonLeap) || IsPossible(months, nonLeapAndNonLeap);
        Console.WriteLine("{0}", possible ? "YES" : "NO");
        Console.ReadLine();
    }
}


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

namespace DivisaoConquista
{
    public static class Operacao
    {
        static public long[] Vetor; //vetor auxiliar

        static public long Calcula(long n, int i)
        {
            long m = n / Vetor[i]; //auxiliar para dividir o número {aplicação da técnica}
            n = n % Vetor[i]; //atualização de n para o resto da divisão

            if (n == 0) //Se chegar ao fim
                return m * i; //auxiliar * 'posição' atual
            else //retorna o produto do auxiliar pelo menor valor entre a qtd de 1 para o número e a posição anterior e para a
                return m * i + Math.Min(Calcula(n, i - 1), i + Calcula(Vetor[i] - n, i - 1));
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            /*O Prof. Vasechkin quer representar o inteiro positivo n como uma soma de adendos,
             * onde cada adendo é um número inteiro contendo apenas 1 s.
             * Por exemplo, ele pode representar 121 como 121 = 111 + 11 + -1.
             * Encontrar o menor número de dígitos 1 em tal soma.
             */
            Rodar();
        }

        static void Rodar()
        {
            long n;
            long[] vetor = new long[17];

            for (int i = 1; i < vetor.Length; i++)
            {
                vetor[i] = vetor[i - 1] * 10 + 1;
            }

            Operacao.Vetor = vetor;
            n = long.Parse(Console.ReadLine());
            Console.Write(Operacao.Calcula(n, 16));
        }
    }
}


using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
public class Codeforces
{
    protected static TextReader reader;
    protected static TextWriter writer;
    static int gdiv(long a)
    {
        var t = Math.Sqrt(a);
        var c = 0;
        for (int i = 2; i < (long)t + 1; i++)
        {
            if (a % i == 0)
            {
                c++;
            }
        }
        if (t == (long)t)
        {
            c--;
        }
        return c;
    }
    #region Prime Numbers <100
    private static readonly int[] Primes =
    new int[] { 2, 3, 5, 7, 11, 13, 17, 19, 23,
                    29, 31, 37, 41, 43, 47, 53, 59,
                    61, 67, 71, 73, 79, 83, 89, 97 };
    #endregion
    private const int _startNum = 101;
    #region IsPrime: primality Check
    /// <summary>
    /// Check if the number is Prime
    /// </summary>
    /// <param name="Num">Int64</param>
    /// <returns>bool</returns>
    public static bool IsPrime(Int64 Num)
    {
        int j;
        bool ret;
        Int64 _upMargin = (Int64)Math.Sqrt(Num) + 1; ;
        // Check if number is in Prime Array
        for (int i = 0; i < Primes.Length; i++)
        {
            if (Num == Primes[i]) { return true; }
        }
        // Check divisibility w/Prime Array
        for (int i = 0; i < Primes.Length; i++)
        {
            if (Num % Primes[i] == 0) return false;
        }
        // Main iteration for Primality check
        _upMargin = (Int64)Math.Sqrt(Num) + 1;
        j = _startNum;
        ret = true;
        while (j <= _upMargin)
        {
            if (Num % j == 0) { ret = false; break; }
            else { j = j + 2; }
        }
        return ret;
    }
    /// <summary>
    /// Check if number-string is Prime
    /// </summary>
    /// <param name="Num">string</param>
    /// <returns>bool</returns>
    public static bool IsPrime(string StringNum)
    {
        return IsPrime(Int64.Parse(StringNum));
    }
    #endregion
    #region Fast Factorization
    /// <summary>
    /// Factorize string converted to long integers
    /// </summary>
    /// <param name="StringNum">string</param>
    /// <returns>Int64[]</returns>
    public static Int64[] FactorizeFast(string StringNum)
    {
        return FactorizeFast(Int64.Parse(StringNum));
    }
    /// <summary>
    /// Factorize long integers: speed optimized
    /// </summary>
    /// <param name="Num">Int64</param>
    /// <returns>Int64[]</returns>
    public static Int64[] FactorizeFast(Int64 Num)
    {
        #region vars
        // list of Factors
        List<Int64> _arrFactors = new List<Int64>();
        // temp variable
        Int64 _num = Num;
        #endregion
        #region Check if the number is Prime (<100)
        for (int k = 0; k < Primes.Length; k++)
        {
            if (_num == Primes[k])
            {
                _arrFactors.Add(Primes[k]);
                return _arrFactors.ToArray();
            }
        }
        #endregion
        #region Try to factorize using Primes Array
        for (int k = 0; k < Primes.Length; k++)
        {
            int m = Primes[k];
            if (_num < m) break;
            while (_num % m == 0)
            {
                _arrFactors.Add(m);
                _num = (Int64)_num / m;
            }
        }
        if (_num < _startNum)
        {
            _arrFactors.Sort();
            return _arrFactors.ToArray();
        }
        #endregion
        #region Main Factorization Algorithm
        Int64 _upMargin = (Int64)Math.Sqrt(_num) + 1;
        Int64 i = _startNum;
        while (i <= _upMargin)
        {
            if (_num % i == 0)
            {
                _arrFactors.Add(i);
                _num = _num / i;
                _upMargin = (Int64)Math.Sqrt(_num) + 1;
                i = _startNum;
            }
            else { i = i + 2; }
        }
        _arrFactors.Add(_num);
        _arrFactors.Sort();
        return _arrFactors.ToArray();
        #endregion
    }
    #endregion
    static IEnumerable<int> GetDivisors(int n)
    {
        return from a in Enumerable.Range(2, n / 2)
               where n % a == 0
               select a;
    }
    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);
        var q = ReadLong();
        var div = FactorizeFast(q);
        if (div.Length < 2)
        {
            Console.WriteLine(1);
            Console.WriteLine(0);
            reader.Close();
            writer.Close();
            return;
        }
        if (div.Length == 2)
        {
            Console.WriteLine(2);
            reader.Close();
            writer.Close();
            return;
        }
        Console.WriteLine(1);
        Console.WriteLine(div[0] * div[1]);
        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.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){

		long[][] nCr = new long[21][];
		for(int i=0;i<21;i++){
			nCr[i] = new long[21];
		}

		nCr[0][0] = 1;
		for(int i=1;i<21;i++){
			nCr[i][0] = 1;
			for(int j=1;j<21;j++){
				nCr[i][j] = nCr[i-1][j] + nCr[i-1][j-1];
			}
		}
		long[] dp = new long[N+1];
		dp[0] = 1;
		int[] cnt = new int[10];
		for(int i=0;i<N;i++) cnt[S[i] - '0']++;
//Console.WriteLine("ok");

		for(int v=9;v>=0;v--){
			if(cnt[v] == 0) continue;
//Console.WriteLine(String.Join(" ",  dp));
			long[] ndp = new long[N+1];
			for(int l=0;l<=N;l++){
				if(dp[l] == 0) continue;
				for(int c = 1; c <= cnt[v]; c++){
					int m = l + 1;
					if(v == 0) m--;
					ndp[l + c] += dp[l] * nCr[m - 1 + c][c];
				}
			}
			dp = ndp;
//Console.WriteLine("ndpp:{0}",String.Join(" ",  dp));
		}

		Console.WriteLine(dp.Sum());
	}
	int N;
	String S;
	public Sol(){
		S = rs();
		N = S.Length;
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}


using System;
using System.Text;

namespace CodeForces
{
    class Program
    {
        public static bool IsPrim(int n, int k)
        {
            if(k == 1)
                return false;

            if(n==2 && k <=2)
                return true;

            for (int i = 2; i <= Math.Sqrt(n); i++)
                if (n % i == 0 && (i >= k ||  n / i >= k))
                    return false;
            return true;
        }
        static void Main()
        {
            var input = Console.ReadLine().Split(' ');
            var n = Int32.Parse(input[0]);
            var m = Int32.Parse(input[1]);
            var k = Int32.Parse(input[2]);

            if (m < 2 * k || n % 2 == 0 || IsPrim(m, k))
            {
                Console.WriteLine("Marsel");
                return;
            }
            Console.WriteLine("Timur");
        }
    }
}


using System;
using System.IO;

class SOS{
    static void Main(){
         string[] tmp = Console.ReadLine().Split();
         int n=int.Parse(tmp[0]);
         int k=int.Parse(tmp[1]);
         string S=Console.ReadLine();
         int ans=0;
         for(int i=0;i+k-1<n;i++){
             int ok=1;
             char[] s=S.ToCharArray();
             for(int j=i;j<=i+k-1;j++){
                 if(s[j]=='?')s[j]='N';
                 if(s[j]=='Y')ok=0;
             }
             if(ok==0)continue;
             for(int j=0;j<n;j++)
                 if(s[j]=='?')s[j]='Y';
             int cur=0,mx=0;
             for(int j=0;j<n;j++){
                 if(s[j]=='N'){
                     cur++;
                     if(cur>mx)mx=cur;
                 }else{
                     cur=0;
                 }
             }
             if(mx==k)
                ans=1;
         }
         if(ans==1)
            Console.WriteLine("YES");
            else

            Console.WriteLine("NO");
    }

}


//

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Threading;
using System.Diagnostics;
using System.Globalization;
using System.Text.RegularExpressions;
using System.Linq;

namespace sar_cs
{
    static class Helpers
    {
        // Mono lacks this override of string.Join()
        public static string Join<T>(this IEnumerable<T> objs, string sep)
        {
            var sb = new StringBuilder();
            foreach (var s in objs) { if (sb.Length != 0) sb.Append(sep); sb.Append(s); }
            return sb.ToString();
        }

        public static string AsString(this double a, int digits)
        {
            return a.ToString("F" + digits, CultureInfo.InvariantCulture);
        }

        public static Stopwatch SW = Stopwatch.StartNew();
    }

    public class Program
    {
        #region Helpers

        public class Parser
        {
            const int BufSize = 8000;
            TextReader s;
            char[] buf = new char[BufSize];
            int bufPos;
            int bufDataSize;
            bool eos;   // eos read to buffer
            int lastChar = -2;
            int nextChar = -2;
            StringBuilder sb = new StringBuilder();

            void FillBuf()
            {
                if (eos) return;
                bufDataSize = s.Read(buf, 0, BufSize);
                if (bufDataSize == 0) eos = true;
                bufPos = 0;
            }

            int Read()
            {
                if (nextChar != -2)
                {
                    lastChar = nextChar;
                    nextChar = -2;
                }
                else
                {
                    if (bufPos == bufDataSize) FillBuf();
                    if (eos) lastChar = -1;
                    else lastChar = buf[bufPos++];
                }
                return lastChar;
            }

            void Back()
            {
                if (lastChar == -2) throw new Exception();  // no chars were ever read
                nextChar = lastChar;
            }

            public Parser()
            {
                s = Console.In;
            }

            public int ReadInt()
            {
                int res = 0;
                int sign = -1;
                int c;
                do { c = Read(); } while (c >= 0 && char.IsWhiteSpace((char)c));
                if (c == '-') { sign = 1; c = Read(); }
                int len = 0;
                while (c >= 0 && !char.IsWhiteSpace((char)c))
                {
                    if ((uint)(c -= 48) >= 10) throw new FormatException();
                    len++;
                    res = checked(res * 10 - c);
                    c = Read();
                }
                if (len == 0) throw new FormatException();
                Back();
                return checked(res * sign);
            }

            public long ReadLong()
            {
                long res = 0;
                int sign = -1;
                int c;
                do { c = Read(); } while (c >= 0 && char.IsWhiteSpace((char)c));
                if (c == '-')
                {
                    sign = 1;
                    c = Read();
                }
                int len = 0;

                while (c >= 0 && !char.IsWhiteSpace((char)c))
                {
                    if ((uint)(c -= 48) >= 10) throw new FormatException();
                    len++;
                    res = checked(res * 10 - c);
                    c = Read();
                }
                if (len == 0) throw new FormatException();
                Back();
                return checked(res * sign);
            }

            public int ReadLnInt()
            {
                int res = ReadInt(); ReadLine(); return res;
            }

            public long ReadLnLong()
            {
                long res = ReadLong(); ReadLine(); return res;
            }

            public double ReadDouble()
            {
                int c;
                do { c = Read(); } while (c >= 0 && char.IsWhiteSpace((char)c));

                int sign = 1;
                if (c == '-') { sign = -1; c = Read(); }

                sb.Length = 0;
                while (c >= 0 && !char.IsWhiteSpace((char)c))
                {
                    sb.Append((char)c); c = Read();
                }

                Back();
                var res = double.Parse(sb.ToString(), CultureInfo.InvariantCulture);
                return res * sign;
            }

            public string ReadLine()
            {
                int c = Read();
                sb.Length = 0;
                while (c != -1 && c != 13 && c != 10)
                {
                    sb.Append((char)c); c = Read();
                }
                if (c == 13) { c = Read(); if (c != 10) Back(); }
                return sb.ToString();
            }

            public bool SeekEOF
            {
                get
                {
                L0:
                    int c = Read();
                    if (c == -1) return true;
                    if (char.IsWhiteSpace((char)c)) goto L0;
                    Back();
                    return false;
                }
            }

            public int[] ReadIntArr(int n)
            {
                var a = new int[n]; for (int i = 0; i < n; i++) a[i] = ReadInt(); return a;
            }

            public long[] ReadLongArr(int n)
            {
                var a = new long[n]; for (int i = 0; i < n; i++) a[i] = ReadLong(); return a;
            }
        }

        static void pe() { Console.WriteLine("???"); Environment.Exit(0); }
        static void re() { Environment.Exit(55); }
        static void Swap<T>(ref T a, ref T b) { T t = a; a = b; b = t; }
        static int Sqr(int a) { return a * a; }
        static long SqrL(int a) { return (long)a * a; }
        static long Sqr(long a) { return a * a; }
        static double Sqr(double a) { return a * a; }

        static StringBuilder sb = new StringBuilder();
        static Random rand = new Random(5);

        #endregion Helpers

        static void Main(string[] args)
        {
            checked
            {
                //Console.SetIn(File.OpenText("_input"));
                var parser = new Parser();
                while (!parser.SeekEOF)
                {
                    long x = parser.ReadInt();
                    long t = parser.ReadInt();
                    long a = parser.ReadInt();
                    long b = parser.ReadInt();
                    long da = parser.ReadInt();
                    long db = parser.ReadInt();

                    var result = "NO";

                    for (int ta = 0; ta <= t; ta++)
                        for (int tb = 0; tb <= t; tb++)
                        {
                            //long cost_a=a
                            long res = 0;
                            if (ta < t) res += (a - ta * da);
                            if (tb < t) res += (b - tb * db);
                            if (res == x)
                            {
                                result = "YES";
                                break;
                            }
                        }

                    Console.WriteLine(result);
                }
            }
        }

        //static void Main(string[] args)
        //{
        //    new Thread(Main2, 50 << 20).Start();
        //}
    }
}