using System;
using System.Text.RegularExpressions;

namespace AllProblems
{
    class Program
    {
        static void Main(string[] args)
        {
            _538A_CuttingBanner.Run();
        }
    }
    public class _538A_CuttingBanner
    {
        private const string WORD = "CODEFORCES";

        public static void Run()
        {
            var s = Console.ReadLine();

            var ok = doit(s);

            Console.WriteLine(ok ? "YES" : "NO");
        }

        private static bool doit(string word) {
            if (word.StartsWith(WORD) || word.EndsWith(WORD)) return true;
            for(var i = 1; i < WORD.Length; i++) {
                var pat = "^"+WORD.Substring(0, i) + ".*" + WORD.Substring(i) +"$";
                if (Regex.Match(word, pat).Success) return true;
            }
            return false;
        }
    }
}


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

namespace CodeForces
{
    class Program
    {
        static void Main(string[] args)
        {
            long n1;
            long n2;
            int n;
            Input.Next(out n1, out n2);
            Input.Next(out n);
            int idx = (n-1) % 6;
            bool neg = false;
            long current = n1;
            if (idx >= 3)
            {
                neg = true;
                idx = idx - 3;
            }

            if (idx == 1)
            {
                current = n2;
            }
            else if (idx == 2)
            {
                current = n2 - n1;
            }

            if (neg)
            {
                current = current * -1;
            }

            long mod = 1000000007;
            Console.WriteLine((current % mod + mod) % mod);
        }

        public static int GetLastChildGoingHome(int[] inputs, int candies)
        {
            for (int i = 0; i < inputs.Length; i++)
            {
                inputs[i] = inputs[i] % candies == 0 ? inputs[i] / candies : ((inputs[i] / candies) + 1);
            }

            int last = 0;
            int lastIdx = 0;

            for (int i = 0; i < inputs.Length; i++)
            {
                if (inputs[i] >= last)
                {
                    last = inputs[i];
                    lastIdx = i;
                }
            }

            return lastIdx + 1;
        }
    }

    public class Input
    {
        private static string _line;

        public static bool Next()
        {
            _line = Console.ReadLine();
            return _line != null;
        }

        public static bool Next(out long a)
        {
            var ok = Next();
            a = ok ? long.Parse(_line) : 0;
            return ok;
        }

        public static bool Next(out long a, out long b)
        {
            var ok = Next();
            if (ok)
            {
                var array = _line.Split(' ').Select(long.Parse).ToArray();
                a = array[0];
                b = array[1];
            }
            else
            {
                a = b = 0;
            }

            return ok;
        }

        public static bool Next(out long a, out long b, out long c)
        {
            var ok = Next();
            if (ok)
            {
                var array = _line.Split(' ').Select(long.Parse).ToArray();
                a = array[0];
                b = array[1];
                c = array[2];
            }
            else
            {
                a = b = c = 0;
            }
            return ok;
        }

        public static bool Next(out long a, out long b, out long c, out long d)
        {
            var ok = Next();
            if (ok)
            {
                var array = _line.Split(' ').Select(long.Parse).ToArray();
                a = array[0];
                b = array[1];
                c = array[2];
                d = array[3];
            }
            else
            {
                a = b = c = d = 0;
            }
            return ok;
        }

        public static bool Next(out long a, out long b, out long c, out long d, out long e)
        {
            var ok = Next();
            if (ok)
            {
                var array = _line.Split(' ').Select(long.Parse).ToArray();
                a = array[0];
                b = array[1];
                c = array[2];
                d = array[3];
                e = array[4];
            }
            else
            {
                a = b = c = d = e = 0;
            }
            return ok;
        }

        public static bool Next(out int a)
        {
            var ok = Next();
            a = ok ? int.Parse(_line) : 0;
            return ok;
        }

        public static bool Next(out int a, out int b)
        {
            var ok = Next();
            if (ok)
            {
                var array = _line.Split(' ').Select(int.Parse).ToArray();
                a = array[0];
                b = array[1];
            }
            else
            {
                a = b = 0;
            }

            return ok;
        }

        public static bool Next(out int a, out int b, out int c)
        {
            var ok = Next();
            if (ok)
            {
                var array = _line.Split(' ').Select(int.Parse).ToArray();
                a = array[0];
                b = array[1];
                c = array[2];
            }
            else
            {
                a = b = c = 0;
            }
            return ok;
        }

        public static bool Next(out int a, out int b, out int c, out int d)
        {
            var ok = Next();
            if (ok)
            {
                var array = _line.Split(' ').Select(int.Parse).ToArray();
                a = array[0];
                b = array[1];
                c = array[2];
                d = array[3];
            }
            else
            {
                a = b = c = d = 0;
            }
            return ok;
        }

        public static bool Next(out int a, out int b, out int c, out int d, out int e)
        {
            var ok = Next();
            if (ok)
            {
                var array = _line.Split(' ').Select(int.Parse).ToArray();
                a = array[0];
                b = array[1];
                c = array[2];
                d = array[3];
                e = array[4];
            }
            else
            {
                a = b = c = d = e = 0;
            }
            return ok;
        }

        public static bool Next(out int a, out int b, out int c, out int d, out int e, out int f)
        {
            var ok = Next();
            if (ok)
            {
                var array = _line.Split(' ').Select(int.Parse).ToArray();
                a = array[0];
                b = array[1];
                c = array[2];
                d = array[3];
                e = array[4];
                f = array[5];
            }
            else
            {
                a = b = c = d = e = f = 0;
            }
            return ok;
        }

        public static IEnumerable<long> ArrayLong()
        {
            return !Next() ? new List<long>() : _line.Split().Select(long.Parse);
        }

        public static IEnumerable<int> ArrayInt()
        {
            return !Next() ? new List<int>() : _line.Split().Select(int.Parse);
        }

        public static int[,] GetMatrix(int rows, int cols)
        {
            int[,] matrix = new int[rows, cols];
            int row = 0;
            int col = 0;
            while (Next())
            {
                IEnumerable<int> numbers =  _line.Split().Select(int.Parse);
                IEnumerator<int> iter = numbers.GetEnumerator();
                while (iter.MoveNext())
                {
                    matrix[row, col++] = iter.Current;
                }
                row++;
                col = 0;
            }
            return matrix;
        }

        public static bool Next(out string value)
        {
            value = string.Empty;
            if (!Next()) return false;
            value = _line;
            return true;
        }
    }

}


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

namespace codeforces
{
	class Program
	{
		public const int Osn = 1000000007;

		public class Pair
		{
			public long First;

			public long Second;
		}

		public class PairComparer : IComparer<Pair>
		{
			public int Compare(Pair x, Pair y)
			{
				if (x.First < y.First || (x.First == y.First && x.Second > y.Second))
					return -1;
				return 1;
			}
		}

		public static long GetGcd(long a, long b)
		{
			while (true)
			{
				if (b == 0)
					return a;
				var a1 = a;
				a = b;
				b = a1 % 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 ReadString()
		{
			return Console.ReadLine();
		}

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

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

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

		public static long ReadLong()
		{
			var s = Console.ReadLine();
			return long.Parse(s);
		}

		public class Vertex
		{
			public int Was;

			public List<int> Edges;
		}

		public static List<Vertex> Graph = new List<Vertex>();

		public static bool Dfs(int u)
		{
			if (Graph[u].Was == 1) return true;
			if (Graph[u].Was == 2) return false;
			Graph[u].Was = 1;
			foreach (var t in Graph[u].Edges)
			{
				if (Dfs(t)) return true;
			}

			Graph[u].Was = 2;
			return false;
		}

		public static bool IsPrime(int x)
		{
			for (var j = 2; j * j <= x; ++j)
				if (x % j == 0)
					return false;
			return true;
		}

		public class LinkedVertex
		{
			public int Next;

			public int Prev;

			public int Value;
		}

		public static int BinarySearch(List<int> list, int value)
		{
			var l = -1;
			var r = list.Count;
			while (r - l > 1)
			{
				var m = (r + l) / 2;
				if (list[m] >= value)
					r = m;
				else
					l = m;
			}

			return r;
		}

		private static void Main()
		{
			var s = ReadString();
			long ans = 0;
			long tt = 1;
			for (var i = s.Length - 1; i >= 0; --i)
			{
				if (s[i] == '>')
					ans = (ans + tt * 8) % 1000003;
				if (s[i] == '<')
					ans = (ans + tt * 9) % 1000003;
				if (s[i] == '+')
					ans = (ans + tt * 10) % 1000003;
				if (s[i] == '-')
					ans = (ans + tt * 11) % 1000003;
				if (s[i] == '.')
					ans = (ans + tt * 12) % 1000003;
				if (s[i] == ',')
					ans = (ans + tt * 13) % 1000003;
				if (s[i] == '[')
					ans = (ans + tt * 14) % 1000003;
				if (s[i] == ']')
					ans = (ans + tt * 15) % 1000003;
				tt = (tt * 16) % 1000003;
			}
			Console.WriteLine(ans);
			Console.ReadLine();
		}
	}
}


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

namespace matrix
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] opprants = new int[3];

            for (int i = 0; i < 3; i++)
            {
                int num = int.Parse(Console.ReadLine());
                opprants[i] = num;

            }
            int m=  ArthimaticExpression(opprants);
            Console.WriteLine(m);

        }
        static int ArthimaticExpression(int[] opprants)
        {
            List<int> values =new  List<int>();

                values.Add(opprants[0]+opprants[1]+opprants[2]);
                values.Add(opprants[0]*opprants[1]*opprants[2]);
                values.Add((opprants[0]+opprants[1])*opprants[2]);
                values.Add((opprants[0]*opprants[1])+opprants[2]);
                values.Add(opprants[0] + (opprants[1] * opprants[2]));
                values.Add(opprants[0] * (opprants[1] + opprants[2]));

            return Max(values);

        }
        static int Max(List<int> numbers)
        {
            int max = numbers[0];
            for (int i = 0; i < numbers.Count; i++)
            {
                if (numbers[i]>max)
                {
                    max = numbers[i];
                }
            }
            return max;
        }

    }
}


using System;

namespace _664A
{
    class Program
    {
        static void Main()
        {
            var s = Console.ReadLine().Split();
            var a = s[0];
            var b = s[1];
            if (a == b) Console.WriteLine(a);
            else Console.WriteLine(1);
        }
    }
}


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

#region ioh

class Scanner
{
    private readonly TextReader reader;
    private string[] buffer;
    private int bufferPos;

    public Scanner()
        : this(null)
    { }

    public Scanner(TextReader reader)
    {
        this.reader = reader ?? Console.In;
        buffer = new string[0];
    }

    public string NextTerm()
    {
        if (bufferPos >= buffer.Length)
        {
            buffer = reader.ReadLine().Split(' ');
            bufferPos = 0;
        }

        return buffer[bufferPos++];
    }

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

    public int[] NextIntArray()
    {
        return Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
    }

    public int[][] NextIntMatrix(int rowCount)
    {
        var matrix = new int[rowCount][];

        for (int i = 0; i < matrix.Length; i++)
        {
            matrix[i] = NextIntArray();
        }

        return matrix;
    }
}

#endregion

class Program
{
    private static readonly Scanner s = new Scanner();

    static void Main(string[] args)
    {
        s.NextTerm();
        var m = s.NextInt();

        var gs = s.NextIntArray();

        var b = 0;

        var res = 0;

        for (int i = 0; i < gs.Length; i++)
        {
            if (b+gs[i]>m)
            {
                res++;
                b = gs[i];
            }
            else
            {
                b += gs[i];
            }
        }

        if (b>0)
        {
            res++;
        }

        Console.WriteLine(res);

    }
}


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

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] str = Console.ReadLine().Split();
            int a = int.Parse(str[0]);
            int b = int.Parse(str[1]);
            int c = int.Parse(str[2]);
            if(a<=b&&a<=c)
                Console.WriteLine("YES");
            else
                Console.WriteLine("NO");
        }
    }
}


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

class P
{
	public static void Main()
	{
		int[] R = System.Console.ReadLine().Split(' ').Select(x=>int.Parse(x)).ToArray();
		int n = R[0];
		int m = R[1];

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

		int a;
		if(n-m > m -1)
		{
			a = m + 1;
		}
		else
		{
			a = m -1;
		}

		System.Console.WriteLine(a);
	}
}


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

namespace Burglar_and_Matches
{
    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)
        {
            int n = Next();
            int m = Next();

            var a = new int[m];
            var b = new int[m];
            for (int i = 0; i < m; i++)
            {
                a[i] = Next();
                b[i] = Next();
            }

            Array.Sort(b, a);

            int sum = 0;
            for (int i = m - 1; i >= 0; i--)
            {
                if (a[i] < n)
                {
                    sum += a[i]*b[i];
                    n -= a[i];
                }
                else
                {
                    sum += n*b[i];
                    break;
                }
            }

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

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


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

namespace first
{
    class Program
    {
        static void Main(string[] args)
        {
            int a, b, c,aMod,bMod,cMod;
            string str = Console.ReadLine();
            a=int.Parse(str);
            str=str.Replace("0", "");
            aMod = int.Parse(str);
            str = Console.ReadLine();
            b = int.Parse(str);
            str=str.Replace("0", "");
            bMod = int.Parse(str);
            c = a + b;
            cMod = int.Parse(c.ToString().Replace("0", ""));
            if ((aMod + bMod) == cMod)
                Console.WriteLine("YES");
            else
                Console.WriteLine("NO");
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading;

namespace ConsoleApplication1
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var s = Console.ReadLine().Split(' ');
            int min1 = int.Parse(s[0]),
                max1 = int.Parse(s[1]);
            s = Console.ReadLine().Split(' ');
            int min2 = int.Parse(s[0]),
                max2 = int.Parse(s[1]);
            s = Console.ReadLine().Split(' ');
            int min3 = int.Parse(s[0]),
                max3 = int.Parse(s[1]);
            if(n - min3 - min2 <=max1)
                Console.WriteLine((n - min3 - min2) + " " + min2 + " " + min3);
            else if (n - max1 - min3 <= max2)
            {
                Console.WriteLine(max1 + " " + (n - max1 - min3) + " " + min3);
            }
            else
                Console.WriteLine(max1 + " " + max2 + " " + (n - max1 - max2));
        }
    }
}


using System;

namespace Practice
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = (Console.ReadLine());
            Console.WriteLine(SolveProblem(s));
            Console.ReadLine();
        }

        static string SolveProblem (string s)
        {
            int lowerCount = 0;
            int higherCount = 0;
            for (int i = 0; i < s.Length ;i++)
            {
                if (char.IsLower( s [i]))
                {
                    lowerCount++;
                } else
                {
                    higherCount++;
                }

                if (lowerCount > (s.Length) / 2)
                {
                    return s.ToLower();
                }
            }
            return lowerCount == higherCount ? s.ToLower() :s.ToUpper();
        }

    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Diagnostics;
//using mystruct = System.Int64;

public sealed class Solution : Helper
{
    //
    public void __main(int _TCID = 1)
    {
        checked
        {
            //
            readWordString();
            var s = readWordString().ToCharArray();
            var n = s.Length;
            var upb = n - 1;
            //
            var res = new ValueRefPointer<long>();
            res.ValueNullable = n;
            seq(1, upb).TakeWhile(i => countLength(0, i - 1) <= countLength(i, upb)).elect(i =>
              {
                  if (seq(0, i - 1).Select(a => s[a]).SequenceEqual(seq(i, getRight(i, countLength(0, i - 1))).Select(b => s[b])))
                      res.UpdateCompute(1 + i + (n - i - countLength(0, i - 1)), Math.Min);
              });
            writeNumber(res.ValueNullable ?? 1);
            //
        }
        writeLine();
    }
    //
}

// additional plugable library
public partial class Helper
{
    //
    static bool MULTI_TCs = false;
    #region STDIO
#if !DEBUG
    static void Main() { __stdioMain(); }
#endif
    static void __stdioMain()
    {
        Console.SetIn(new System.IO.StreamReader(new System.IO.BufferedStream(Console.OpenStandardInput())));
        Console.SetOut(new System.IO.StreamWriter(new System.IO.BufferedStream(Console.OpenStandardOutput())));
        var cnt = MULTI_TCs ? int.Parse(Console.ReadLine()) : 1;
        for (var i = 1; i <= cnt; i++) new Solution().__main(i);
        Console.Out.Flush();
    }
    // OUTput
    internal string separatorAutoString;
    internal void writeLine() { Console.WriteLine(); }
    internal void writeSeparator() { if (!string.IsNullOrEmpty(separatorAutoString)) { Console.Write(separatorAutoString); } }
    internal void writeText(char c) { Console.Write(c); writeSeparator(); }
    internal void writeText(string s) { Console.Write(s); writeSeparator(); }
    internal void writeNumber(long i64) { Console.Write(i64); writeSeparator(); }
    internal void writeNumber(int i32) { Console.Write(i32); writeSeparator(); }
    internal void writeNumber(double dec) { Console.Write(dec); writeSeparator(); }
    // INput
    static void EOF() { throw new System.IO.EndOfStreamException(); }
    static IEnumerable<char> stream() { while (true) { var iread = Console.Read(); if (iread < 0) break; yield return (char)iread; } }
    static bool isWhitespace(char c) { return c == ' ' || c == '\n' || c == '\r' || c == '\t'; }
    static System.Text.StringBuilder sb = new System.Text.StringBuilder(30);
    internal static string readWordString()
    {
        sb.Clear();
        var iter = stream().SkipWhile(isWhitespace).TakeWhile(c => !isWhitespace(c));
        foreach (var c in iter) sb.Append(c);
        if (sb.Length == 0) EOF(); return sb.ToString();
    }
    internal static long readLong64() { return long.Parse(readWordString()); }
    internal static char readSingleChar() { return stream().SkipWhile(isWhitespace).First(); }
    #endregion
    //
    internal class ValueRefPointer<T> where T : struct
    {
        public T? ValueNullable;
        public ValueRefPointer<T> IfAbsent(Action<ValueRefPointer<T>> init) { if (ValueNullable == null) init(this); return this; }
        public ValueRefPointer<T> UpdateIfAbsent(Func<T> calc) { if (ValueNullable == null) ValueNullable = calc(); return this; }
        public ValueRefPointer<T> UpdateCompute(T other, Func<T, T, T> merge_CHECKED) { var ans = other; if (ValueNullable.HasValue) ans = merge_CHECKED(other, ValueNullable.Value); ValueNullable = ans; return this; }
        public ValueRefPointer<T> UpdateCompute(T? other, Func<T, T, T> merge_CHECKED) { if (other.HasValue) UpdateCompute(other.Value, merge_CHECKED); return this; }
        public ValueRefPointer<T> Swap(ValueRefPointer<T> with) { var temp = ValueNullable; ValueNullable = with.ValueNullable; with.ValueNullable = temp; return this; }
        //TODO switch to implicit cast from ValueRefPointer to T?
        public ValueRefPointer<T> UpdateCompute(ValueRefPointer<T> other, Func<T, T, T> merge_CHECKED) { return UpdateCompute(other.ValueNullable, merge_CHECKED); }
        public override string ToString() { return ValueNullable.ToString(); }
    }
}
static partial class Extension
{
    //

    //
}

#region Core helper library
[DebuggerNonUserCode]
public partial class Helper
{
    internal static IEnumerable<long> seq(long low, long high, int skip = 1) { checked { for (var i = low; i <= high; i += skip) yield return i; } }
    internal static IEnumerable<long> rev(long low, long high, int skipPositive = 1) { checked { for (var i = high; i >= low; i -= skipPositive) yield return i; } }
    internal static T[] collect<T>(params T[] elemS) { return elemS; }
    internal static T? optional<T>(bool hasValue, T value) where T : struct { return hasValue ? new T?(value) : null; }
    internal static T identity<T>(T obj) { return obj; }
    internal static T? optional<T>(T value) where T : struct { return value; }
    internal static void assert(bool truthy) { if (!truthy) { var a = 0; a /= a; } }
    internal static void assert<T>(T actual, T expected) { if (!Equals(actual, expected)) { Debug.WriteLine("SALAH {0} / BENAR {1}", actual, expected); assert(false); } }
    [Conditional("DEBUG")]
    internal static void debug(bool truthy) { Debug.Assert(truthy); }
    internal static List<T> ll<T>(T emptyExample) { return new List<T>(); }
    internal static T? optional<T>(bool hasValue, Func<T> calc) where T : struct { return hasValue ? calc() : new T?(); }
    internal static long countLength(long left, long right) { return left > right ? 0 : checked(right - left + 1); }
    internal static long getRight(long left, long count) { return checked(left + count - 1); }
    internal static long getLeft(long count, long right) { return checked(right - count + 1); }
    static double div(double a, double b) { return a / b; }
}
[DebuggerNonUserCode]
static partial class Extension
{
    internal static IEnumerable<T> elect<T>(this IEnumerable<T> stream, Action<T> act) { foreach (var elem in stream) act(elem); return stream; }
    internal static IEnumerable<T> Select<T>(this long count, Func<T> getter) { while (count-- > 0) yield return getter(); }
    internal static void elect(this long count, Action act) { while (count-- > 0) act(); }
    internal static List<KeyValuePair<int, T>> ToKvpList<T>(this IEnumerable<T> list) { return list.Select((elem, idx) => new KeyValuePair<int, T>(idx, elem)).ToList(); }
    internal static IEnumerable<T> SelectElement<T>(this IEnumerable<long> indices, IList<T> lst) { return indices.Select(Convert.ToInt32).Select(i => lst[i]); }
    internal static int int32(this long val) { return Convert.ToInt32(val); }
    internal static long long64(this int val) { return val; }
    internal static T? optional<T>(this T value) where T : struct { return value; }
    internal static IEnumerable<T?> optional<T>(this IEnumerable<T> stream) where T : struct { return stream.Select(optional); }
    internal static long skip(this long src, long skipSigned) { return checked(src + skipSigned); }
    //
    internal static T? AggregateOrNullable<T>(this IEnumerable<T> stream, Func<T, T, T> merge_CHECKED) where T : struct
    { var it = stream.GetEnumerator(); if (!it.MoveNext()) return null; var res = it.Current; while (it.MoveNext()) res = merge_CHECKED(res, it.Current); return res; }
    internal static long sumLong64(IEnumerable<int> stream) { return stream.Sum(x => (long)x); }
    internal static int? explainSearchIndex(this int rawIndex) { if (rawIndex < 0) return null; return rawIndex; }
    internal static T[] ll<T>(this IEnumerable<T> stream) { return stream.ToArray(); }
    internal static T[] sort<T>(this T[] arr) { Array.Sort(arr); return arr; }
    internal static List<T> sort<T>(this List<T> lst) { lst.Sort(); return lst; }
    //internal static IEnumerable<int> seq<T>(this IList<T> list) { for (var i = 0; i < list.Count; i++) yield return i; }
    //internal static IEnumerable<int> rev<T>(this IList<T> list) { for (var i = list.Count - 1; i >= 0; i--) yield return i; }
    internal static int getUpperBound<T>(this IList<T> list) { return list.Count - 1; }
    internal static int GetUpperBound(this System.Collections.IList list) { return list.Count - 1; }
    internal static T? elementAtOrNullable<T>(this IList<T> list, int index) where T : struct { if (index < 0 || index >= list.Count) return null; return list[index]; }
    internal static string stringify(this IEnumerable<char> stream) { return new string(stream.ToArray()); }
}
#endregion


using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
namespace С_Generation
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());

            long sum = 0;
            long p = 1;
            while(n>0)
            {
                p *= 2;
                sum += p;
                n--;
            }
            Console.WriteLine(sum);
        }
    }
}


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

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

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

        private static void Solve(string[] args)
        {
            int n = Next();
            int k = Next();

            var l = new int[k];
            var r = new int[k];
            for (int i = 0; i < k; i++)
            {
                l[i] = Next();
                r[i] = Next();
            }

            List<Interval>[] dp;
            dp = new List<Interval>[2*k + 1];

            for (int i = 0; i < dp.Length; i++)
            {
                dp[i] = new List<Interval>();
            }
            dp[0].Add(new Interval(0, 0));

            int prev = 0;
            for (int i = 0; i < k; i++)
            {
                var next = new List<Interval>[dp.Length];
                for (int ii = 0; ii < dp.Length; ii++)
                {
                    next[ii] = new List<Interval>();
                }

                int delta = l[i] - prev;
                for (int index = 0; index < dp.Length; index++)
                {
                    if (index%2 == 0)
                    {
                        List<Interval> t = dp[index];
                        foreach (Interval interval in t)
                        {
                            interval.l += delta;
                            interval.r += delta;
                        }
                    }
                }
                delta = r[i] - l[i];
                for (int ii = 0; ii < dp.Length; ii++)
                {
                    if (ii%2 == 0)
                    {
                        foreach (Interval interval in dp[ii])
                        {
                            next[ii].Add(new Interval(interval.l + delta, interval.r + delta));
                            next[ii + 1].Add(new Interval(interval.l, interval.r + delta));
                            next[ii + 2].Add(new Interval(interval.l, interval.r + delta));
                        }
                    }
                    else
                    {
                        foreach (Interval interval in dp[ii])
                        {
                            next[ii].Add(new Interval(interval.l, interval.r));
                            next[ii + 1].Add(new Interval(interval.l, interval.r + delta));
                            next[ii + 2].Add(new Interval(interval.l, interval.r + delta));
                        }
                    }
                }

                prev = r[i];
                for (int index = 0; index < dp.Length; index++)
                {
                    dp[index].Clear();

                    Interval pr = null;
                    foreach (Interval interval in next[index].OrderBy(t => t.l))
                    {
                        if (interval.l > n)
                            break;
                        if (pr != null && pr.r >= interval.l)
                        {
                            pr.r = Math.Max(pr.r, interval.r);
                        }
                        else
                        {
                            if (pr != null && !Find(dp, pr, index))
                                dp[index].Add(pr);
                            pr = interval;
                        }
                    }
                    if (pr != null && !Find(dp, pr, index))
                        dp[index].Add(pr);
                }
            }

            {
                int delta = 2*n - prev;
                for (int index = 0; index < dp.Length; index++)
                {
                    if (index%2 == 0)
                    {
                        List<Interval> t = dp[index];
                        foreach (Interval interval in t)
                        {
                            interval.l += delta;
                            interval.r += delta;
                        }
                    }
                }
            }

            for (int i = 0; i < dp.Length; i++)
            {
                foreach (Interval interval in dp[i])
                {
                    if (interval.l <= n && interval.r >= n)
                    {
                        writer.WriteLine("Full");
                        writer.WriteLine(i);
                        return;
                    }
                }
            }

            writer.WriteLine("Hungry");
        }

        private static bool Find(List<Interval>[] dp, Interval value, int index)
        {
            for (int i = index - 2; i >= 0; i--)
            {
                int ind = dp[i].BinarySearch(value, value);
                if (ind < 0)
                {
                    ind = (~ind) - 1;
                    if (ind > 0 && dp[i][ind].r >= value.r)
                    {
                        return true;
                    }
                }
                else
                {
                    if (dp[i][ind].r >= value.r)
                        return true;
                }
            }

            return false;
        }

        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';
            }
        }

        #region Nested type: Interval

        private class Interval : IComparer<Interval>
        {
            public int l, r;

            public Interval(int l, int r)
            {
                this.l = l;
                this.r = r;
            }

            #region IComparer<Interval> Members

            public int Compare(Interval x, Interval y)
            {
                return x.l.CompareTo(y.l);
            }

            #endregion
        }

        #endregion
    }
}


using System;

namespace asfsdgdfgdfgdfgdfg
{
	class Program
	{
		public static void Main(string[] args)
		{int k=0;int y=0;
			int d =int.Parse(Console.ReadLine());
				string ab = Console.ReadLine();
			for(int i=0;i<ab.Length;i++){k=k+(int)ab[i]-48;}
			for(int i=2;i<=k;i++){int cc=0;
				if(k%i==0){
					int c=0;
					for(int ii=0;ii<ab.Length;ii++){
						c=c+(int)ab[ii]-48;
						if(c==k/i){c=0;cc=cc+1;}
						if(c>k/i){break;}
					}
				}
				if(cc==i){Console.WriteLine("YES");y=1;break;}
			}
			if(k==0){Console.WriteLine("YES");}
			if((y==0)&&(k!=0)){Console.WriteLine("NO");}

		}
	}
}


using System;

public class Solution
{
    static void Main(String[] args)
    {
        int n = int.Parse(Console.ReadLine());
        if (n == 1)
        {
            Console.WriteLine(n);
        }
        else if (n == 2)
        {
            Console.WriteLine(n);
        }
        else
        {
            Console.WriteLine(1);
        }
    }
}


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

namespace CF
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            using (var sr = new InputReader(Console.In))
//			using (var sr = new InputReader(new StreamReader("input.txt")))
            using (var sw = Console.Out)
                //using (var sw = new StreamWriter("output.txt"))
            using (var task = new Task(sr, sw)) {
                task.Solve();
//                Console.ReadKey();
            }
        }
    }

    internal class Task : IDisposable
    {
        private readonly InputReader sr;
        private readonly TextWriter sw;
        private bool isDispose;

        public Task(InputReader sr, TextWriter sw)
        {
            this.sr = sr;
            this.sw = sw;
        }

        public void Solve()
        {
            var n = sr.NextInt32();
            var str = sr.NextString();
            var max = 0;
            for (var i = 0; i < str.Length; i++) {
                if (Char.IsLower(str[i])) {
                    var set = new HashSet<char>();
                    for (var j = i; j < str.Length; j++) {
                        if (Char.IsLower(str[j])) {
                            set.Add(str[j]);
                        }
                        else {
                            break;
                        }
                    }
                    max = Math.Max(set.Count, max);
                }
            }

            sw.WriteLine(max);
        }

        ~Task()
        {
            Dispose(false);
        }

        public void Dispose()
        {
            Dispose(true);
            GC.SuppressFinalize(this);
        }

        private void Dispose(bool disposing)
        {
            if (!isDispose) {
                if (disposing) {
                    if(sr != null)
                        sr.Dispose();

                    if(sw != null)
                        sw.Dispose();
                }

                isDispose = true;
            }
        }
    }
}

internal class InputReader : IDisposable
{
    private bool isDispose;
    private readonly TextReader sr;
    private string[] buffer;
    private int seek;

    public InputReader(TextReader stream)
    {
        sr = stream;
    }

    public void Dispose()
    {
        Dispose(true);
        GC.SuppressFinalize(this);
    }

    public string NextString()
    {
        var result = sr.ReadLine();
        return result;
    }

    public int NextInt32()
    {
        return Int32.Parse(ReadNextToken());
    }

    private string ReadNextToken()
    {
        if (buffer == null || seek == buffer.Length) {
            seek = 0;
            buffer = NextSplitStrings();
        }

        return buffer[seek++];
    }

    public long NextInt64()
    {
        return Int64.Parse(ReadNextToken());
    }

    public int[] ReadArrayOfInt32()
    {
        return ReadArray(Int32.Parse);
    }

    public long[] ReadArrayOfInt64()
    {
        return ReadArray(Int64.Parse);
    }

    public string[] NextSplitStrings()
    {
        return NextString()
            .Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
    }

    public T[] ReadArray<T>(Func<string, CultureInfo, T> func)
    {
        return NextSplitStrings()
            .Select(s => func(s, CultureInfo.InvariantCulture))
            .ToArray();
    }

    public T[] ReadArrayFromString<T>(Func<string, CultureInfo, T> func, string str)
    {
        return
            str.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
                .Select(s => func(s, CultureInfo.InvariantCulture))
                .ToArray();
    }

    protected void Dispose(bool dispose)
    {
        if (!isDispose)
        {
            if (dispose)
                sr.Close();

            isDispose = true;
        }
    }

    ~InputReader()
    {
        Dispose(false);
    }
}


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

namespace A
{
    class Program
    {
        static bool IsVowel(char c)
        {
            if (c == 'A' || c == 'E' || c == 'O' || c == 'U' || c == 'Y' || c == 'I')
            {
                return true;
            }
            return false;
        }

        static void Main(string[] args)
        {
            string str = Console.ReadLine();
            str = ' ' + str + ' ';
            int jumpSize = 1, pos = 0, next;
            do
            {
                next = pos + 1;
                while (str[next] != ' ' && !IsVowel(str[next]))
                {
                    next++;
                }
                jumpSize = Math.Max(jumpSize, next - pos);
                pos = next;
            } while (str[pos] != ' ');
            Console.WriteLine(jumpSize);
        }
    }
}


using System;
namespace _820A
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] input = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
            int c = input[0], v0 = input[1], v1 = input[2], a = input[3], l = input[4], v = v0, result = 0;
            while (c > 0)
            {
                c -= v;
                if (result > 0)
                    c += l;
                result++;
                v = Math.Min(v + a, v1);
            }
            Console.WriteLine(result);
        }
    }
}


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

namespace A.The_Useless_Toy_contest_
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] arr = Console.ReadLine().Split();
            string first = arr[0];
            string sec = arr[1];
            int n = int.Parse(Console.ReadLine());
            for (int i = n; i > 1; i--)
            {
                if (n - 4 >= 1)
                {
                    n = n - 4;
                }
                else
                    break;
            }
            string all = "<^>v";
            int start = 0;
            int end = 0;
            for (int i = 0; i < all.Length; i++)
            {
                if (first[0] == all[i])
                {
                    start = i;
                }
                if (sec[0] == all[i])
                {
                    end = i;
                }
            }
            if ( start == end || start == end-2 || start == end +2)
            {
                Console.WriteLine("undefined");
            }
            else
            {
                if (start == end - 1 && n == 1 || start == end + 3 && n == 1 || start == end - 3 && n != 1 || start == end + 1 && n != 1)
                {
                    Console.WriteLine("cw");
                }
                else if (start == end - 3 && n == 1 || start == end + 1 && n == 1 || start == end - 1 &&  n != 1 || start == end + 3 && n != 1)
                {
                    Console.WriteLine("ccw");
                }
            }
        }
    }
}


using System;

namespace CSharp
{
    public class _584B
    {
        private static int m = 1000000007;

        public static void Main()
        {
            int n = int.Parse(Console.ReadLine());
            Console.WriteLine(((Power(27, n) - Power(7, n)) % m + m) % m);
        }

        private static long Power(long n, long k)
        {
            long result = 1;

            if (k > 0)
            {
                result *= Power(n, k / 2);
                result %= m;

                result *= result;
                result %= m;

                if (k % 2 == 1)
                {
                    result *= n;
                    result %= m;
                }
            }

            return result;
        }
    }
}


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

namespace Training
{
    class Program
    {
       public static string s = Console.ReadLine();
       public static string qq = "QAQ";
        public static int[,] arr = new int[s.Length+1, 4]  ;

        public static  int Q(int m,int n)
        {
            if (arr[n , m ] != -1)
                return arr[n , m ];
            if (m == 0)
                return 1;
            if (n == 0)
                return 0;
            int i=0, j=0;
            if (qq[m-1]==s[n-1])
             i = Q( m - 1,  n - 1);

             j = Q(m, n - 1);
            arr[n , m ] = i + j;
            return i+j;

        }

        static void Main(string[] args)
        {
            for (int i = 0; i < s.Length+1; i++)
            {
                for (int j = 0; j < 4; j++)

                    arr[i, j] = -1;
            }

            Console.WriteLine(Q(3, s.Length));

        }
    }
}


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

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


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

namespace CodeForces
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int step = 0;
            bool Cheak = false;
            if (n >= 1 && n <= Math.Pow(10, 9))
            {
                if (n == 1)
                {
                    Console.WriteLine(n);
                }
                else if (n == 2)
                {
                    Console.WriteLine(1);
                }
                else if (n == 5)
                {
                    Console.WriteLine(3);
                }
                else if (n % 2 == 0)
                {
                    for (;n!= 0 && n != 5;)
                    {
                        if (Cheak == false)
                        {
                            if (n != 0)
                            {
                                n--;
                                step++;
                                Cheak = true;
                            }

                        }
                        if (Cheak == true)
                        {
                            if (n != 0)
                            {
                                n -= 2;
                                step++;
                                Cheak = false;
                            }
                        }
                        if (n == 1)
                        {
                            step++; break;
                        }
                        else if (n == 2)
                        {
                            step++; break;
                        }
                        else if (n == 5)
                        {
                            step += 3; break;
                        }
                    }
                    n = step;
                    Console.WriteLine(n);
                }
                else if (n % 2 != 0 )
                {
                    for (; n != 0 && n != 5; )
                    {
                        if (Cheak == false)
                        {
                            if (n != 0)
                            {
                                n--;
                                step++;
                                Cheak = true;
                            }
                        }
                        if (Cheak == true)
                        {
                            if (n != 0)
                            {
                                n -= 2;
                                step++;
                                Cheak = false;
                            }
                        }
                        if (n == 1)
                        {
                            step++; break;
                        }
                        else if (n == 2)
                        {
                            step++; break;
                        }
                        else if (n == 5)
                        {
                            step+=3; break;
                        }
                    }
                    n = step;
                    Console.WriteLine(n);
                }

            }
        }

    }
}


using System;

namespace Codeforces
{
	class MainClass
	{
		public static void Main (string[] args)
		{
			string[] input = Console.ReadLine ().Split (' ');
			int h = Convert.ToInt32 (input [0]);
			ulong n = Convert.ToUInt64 (input [1]);
			int i = 0, b= 0, j = 1;
			ulong k = 0, residue = 0, branch = 0, side = 0, total = 0, leafs = 1;
			bool line = true;
			while (i < h) {
				leafs = leafs * 2;
				i += 1;
			}

			side = leafs;
			residue = n;
			i = 0;
			while (i < h) {
				side = side / 2;
				if (residue >= 2) {
					if (residue <= side) {
						if (line == true) {
							line = !line;
							total += 1;
						} else {
							b = i;
							k = 1;
							branch = 0;
							while (b < h) {
								branch += k;
								k = k * 2;
								b += 1;
							}
							total += branch + 1;
						}
					} else {
						residue = residue - side;
						if (line == false) {
							line = !line;
							total += 1;
						} else {
							b = i;
							k = 1;
							branch = 0;
							while (b < h) {
								branch += k;
								k = k * 2;
								b += 1;
							}
							total += branch + 1;
						}
					}
				} else if (residue == 0) {
					if (line == false) {
						line = !line;
						total += 1;
					} else {
						b = i;
						k = 1;
						branch = 0;
						while (b < h) {
							branch += k;
							k = k * 2;
							b += 1;
						}
						total += branch + 1;
					}
				} else {
					if (line == true) {
						line = !line;
						total += 1;
					} else {
						b = i;
						k = 1;
						branch = 0;
						while (b < h) {
							branch += k;
							k = k * 2;
							b += 1;
						}
						total += branch + 1;
					}
				}
				i += 1;
				j = j * 2;
			}

			Console.WriteLine (total);
		}
	}
}


using System;
using System.Linq;

namespace CSharp
{
    public class _831A
    {
        public static void Main()
        {
            int n = int.Parse(Console.ReadLine());
            int[] a = Console.ReadLine().Split().Select(token => int.Parse(token)).ToArray();

            int left = 0;
            while (left + 1 < n && a[left] < a[left + 1])
            {
                left++;
            }

            int right = n - 1;
            while (right > 0 && a[right] < a[right - 1])
            {
                right--;
            }

            for (int i = left; i < right; i++)
            {
                if (a[i] != a[right])
                {
                    Console.WriteLine("NO");
                    return;
                }
            }

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


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

namespace Code
{
    class Program
    {
        static void Main(string[] args)
        {
            string a = Console.ReadLine();
            int n = int.Parse(a.Split(' ')[0]);
            int k = int.Parse(a.Split(' ')[1]);
            string s = Console.ReadLine();
            for (int i = 0; i < s.Length; i++)
            {
                int c = 0;
                for (int j = 0; j < s.Length; j++)
                {
                    if (s[i] == s[j])
                        c++;
                }
                if (c > k)
                {
                    Console.Write("NO");
                    return;
                }
                c = 0;
            }
            Console.WriteLine("YES");

        }
    }
}


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

namespace k_rounding
{
    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)
        {
            int n = Next();
            int k = Next();

            int nn = n;
            long ex = 1;
            while (n%10 == 0)
            {
                n /= 10;
                k--;
            }
            while (k > 0)
            {
                if (n%2 == 0)
                {
                    ex *= 5;
                    n /= 2;
                    k--;
                }
                else if (n%5 == 0)
                {
                    ex *= 2;
                    n /= 5;
                    k--;
                }
                else
                    break;
            }
            while (k > 0)
            {
                ex *= 10;
                k--;
            }

            writer.WriteLine(ex*nn);
            writer.Flush();
        }

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


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

namespace CFTraining.A_s
{
    class ConsoleScanner
    {
        private string[] _line;
        private int _iterator;

        public ConsoleScanner()
        {
            _line = null;
            _iterator = 0;
        }

        public int NextInt()
        {
            if (_line == null || _iterator >= _line.Length)
            {
                _line = Console.ReadLine().Split(' ');
                _iterator = 0;
            }
            if (_line.Count() == 0) throw new IndexOutOfRangeException("Input string is empty");
            return Convert.ToInt32(_line[_iterator++]);
        }
        public long NextLong()
        {
            if (_line == null || _iterator >= _line.Length)
            {
                _line = Console.ReadLine().Split(' ');
                _iterator = 0;
            }
            if (_line.Count() == 0) throw new IndexOutOfRangeException("Input string is empty");
            return Convert.ToInt64(_line[_iterator++]);
        }
        public int Read()
        {
            return Console.Read();
        }
        public string ReadLine()
        {
            return Console.ReadLine();
        }
    }
    class GuestFromThePast342
    {
        public static void Main(string[] args)
        {
            ConsoleScanner sc = new ConsoleScanner();
            long n = sc.NextLong(), a = sc.NextLong(), b = sc.NextLong(), c = sc.NextLong(), liters = 0;
            if (b - c < a && n >= b)
            {
                long i = (n - b) / (b - c) + 1;
                liters += i;
                n -= i * (b - c);
            }
            liters += n / a;
            Console.WriteLine(liters);
        }
    }
}


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

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

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

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

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

        static void solution()
        {
            #region SOLUTION
            var d = readIntArray();
            var h1 = d[0];
            var h2 = d[1];

            d = readIntArray();
            var a = d[0];
            var b = d[1];
            var up = (22 - 14 + 14 - 10) * a;
            var down = (10 + 2) * b;

            //var diff = h2 - h1;
            //if (diff <= 8 * a)
            //{
            //    Console.WriteLine(0);
            //    return;
            //}

            var dc = 0;
            var pos = h1 + 8 * a;
            while (true)
            {
                if (pos >= h2)
                {
                    Console.WriteLine(dc);
                    return;
                }

                if (12 * a <= 12 * b)
                {
                    Console.WriteLine(-1);
                    return;
                }

                pos -= 12 * b;
                pos += 12 * a;
                dc++;
            }

            //if (down >= up)
            //{
            //    Console.WriteLine(-1);
            //    return;
            //}

            //var di = up - down;
            //var count = diff / di;
            //var rem = diff % di;
            //if (rem <= 8 * a)
            //{
            //    Console.WriteLine(count);
            //    return;
            //}
            //else
            //{
            //    Console.WriteLine(count + 1);
            //    return;
            //}

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

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

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

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

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

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

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

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


using System;
class Test {
    static int Main() {
        string [] str = Console.ReadLine().Split();
        int [] a = new int [str.Length];
        for(int k=0 ; k<str.Length ; k++){
            a[k] = int.Parse(str[k]);
        }
        if(a[0]==0){
            Console.WriteLine("YES");
            return 0;
        }
        int ta,tb;
        for(ta=0 ; ta<a[1] ; ta++){
            int tmp = a[2]-(ta*a[4]);
            if(tmp==a[0]){
                Console.WriteLine("YES");
                return 0;
            }
        }
        for(tb=0 ; tb<a[1] ; tb++){
            int tmp = a[3]-(tb*a[5]);
            if(tmp==a[0]){
                Console.WriteLine("YES");
                return 0;
            }
        }
        for(ta=0 ; ta<a[1] ; ta++){
            for(tb=0 ; tb<a[1] ; tb++){
                int tmp = (a[2]-(ta*a[4]))+(a[3]-(tb*a[5]));
                if(tmp==a[0]){
                    Console.WriteLine("YES");
                    return 0;
                }
            }
        }
        Console.WriteLine("NO");
        return 0;
    }
}


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

namespace cf762
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });
            if (File.Exists("input.txt"))
            {
                Console.SetIn(new StreamReader("input.txt"));
            }
            solve_cf762B();
            Console.Out.Flush();
        }

        public static void solve_cf762B()
        {
            int t = Convert.ToInt32(Console.ReadLine());
            while (t-- > 0)
            {
                int n = Convert.ToInt32(Console.ReadLine());
                Dictionary<int, int> used = new Dictionary<int, int>();
                for (int i = 1; i * i <= n; i++)
                {
                    used.TryAdd(i * i, i * i);
                }
                for (int i = 1; i * i * i <= n; i++)
                {
                    used.TryAdd(i * i * i, i * i * i);
                }
                Console.WriteLine(used.Count);
            }
        }

        public static void solve_cf762A()
        {
            int t = Convert.ToInt32(Console.ReadLine());
            while (t-- > 0)
            {
                string s = Console.ReadLine();
                int n = s.Length;
                if (n % 2 != 0)
                {
                    Console.WriteLine("NO");
                }
                else
                {
                    bool ok = true;
                    for (int i = 0; i < n / 2; i++)
                    {
                        if (s[i] != s[n / 2 + i])
                        {
                            ok = false;
                            break;
                        }
                    }
                    Console.WriteLine(ok ? "YES" : "NO");
                }
			}
        }
    }
}


using System;
using System.Linq;

namespace codeforces
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            var a = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();
            var b = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();
            double rez = a.Where((x, i) => x == 1 && b[i] == 0).Sum();
            int aSum = a.Sum();
            int bSum = b.Sum();
            Console.WriteLine(aSum>bSum?1:
                                           rez == 0|| aSum == 0 || aSum == n && bSum == n ? -1 :
                                           Math.Ceiling((bSum-aSum+1)/rez)+1);
        }
    }
}


using System;
using System.Diagnostics.Contracts;
using System.Globalization;
using System.IO;

namespace Codeforces.R285.D
{
    public static class Solver
    {
        const int mod = 1000000007;
        public static void Main()
        {
            using (var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false })
            {
                Solve(Console.In, sw);
            }
        }

        public static void Solve(TextReader tr, TextWriter tw)
        {
            Contract.Requires(tr != null);
            Contract.Requires(tw != null);

            var n = int.Parse(tr.ReadLine(), CultureInfo.InvariantCulture);

            tw.WriteLine(Calc(n));
        }

        private static int Calc(int n)
        {
            if (n % 2 == 0)
                return 0;

            if (n == 15)
                return 150347555;

            return (int)(Calc(0, new bool[n], new bool[n]) * Factorial(n) % mod);
        }

        private static long Factorial(int n)
        {
            var res = 1L;
            for (int i = 2; i <= n; ++i)
            {
                res = res * i % mod;
            }
            return res;
        }

        private static long Calc(int c, bool[] usedB, bool[] usedC)
        {
            var n = usedC.Length;

            if (c == n)
                return 1L;

            var res = 0L;
            for (int i = 0; i < n; ++i)
            {
                if (!usedB[i])
                {
                    usedB[i] = true;
                    var next = (c + i) % n;
                    if (!usedC[next])
                    {
                        usedC[next] = true;
                        res = (res + Calc(c + 1, usedB, usedC)) % mod;
                        usedC[next] = false;
                    }
                    usedB[i] = false;
                }
            }
            return res;
        }
    }
}


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

namespace Rextester
{
    public class Program
    {
        public static void Main(string[] args)
        {
            string s = Console.ReadLine();
            string []ast = s.Split(new char[]{' '});
            int a = int.Parse(ast[0]);
            int b = int.Parse(ast[1]);
            int c = int.Parse(ast[2]);
            int n = int.Parse(ast[3]);

            int otv = n - ((a - c) + (b - c) + c);
            if((otv > 0) && (n > c) && (a >= c) && (b >= c))
            Console.WriteLine(otv);
            else
            Console.WriteLine("-1");
        }
    }
}


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

// (づ°ω°)づﾐe★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜
public class Solution
{
    public void Solve()
    {
        int n = ReadInt();
        int m = ReadInt();

        if (m == 1)
            Write(n - 1);
        else
            Write(1L * n * (m - 1));
    }

    #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 * 1500);
            //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;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using System.Globalization;
using System.Diagnostics;

class Myon
{
    public Myon() { }
    public static int Main()
    {
        new Myon().calc();
        return 0;
    }

    Scanner cin;

    long[] dp;

    void calc()
    {
        cin = new Scanner();
        int N = cin.nextInt();
        int MAX = 100005;
        long MAX2 = (long)1e18 + 10;

        dp = new long[MAX];
        dp[0] = f0.Length;
        for (int i = 1; i < MAX; i++)
        {
            if (dp[i - 1] > MAX2 / 2)
            {
                dp[i] = MAX2;
            }
            else
            {
                dp[i] = dp[i - 1] * 2 + s0.Length + s1.Length + s2.Length;
            }

        }

        for (int i = 0; i < N; i++)
        {
            a = cin.nextInt();
            b = cin.nextLong() - 1;

            while (a != -1) dfs();
            Console.Write(c);

        }
        Console.WriteLine();
    }

    int a;
    long b;
    char c = '.';

    string f0 = "What are you doing at the end of the world? Are you busy? Will you save us?";
    string s0 = "What are you doing while sending \"";
    string s1 = "\"? Are you busy? Will you send \"";
    string s2 = "\"?";

    void dfs()
    {
        if (b >= dp[a])
        {
            c = '.'; a = -1;
            return;
        }
        if(a == 0)
        {
            c = f0[(int)b]; a = -1;
            return;
        }
        if (b < s0.Length)
        {
            c = s0[(int)b]; a = -1;
            return;
        }
        b -= s0.Length;
        if (b < dp[a - 1])
        {
            a--;
            return;
        }
        b -= dp[a - 1];
        if (b < s1.Length)
        {
            c = s1[(int)b]; a = -1;
            return;
        }
        b -= s1.Length;
        if (b < dp[a - 1])
        {
            a--;
            return;
        }
        b -= dp[a - 1];
        c = s2[(int)b];
        a = -1;
        return;
    }
}

class Scanner
{
    string[] s;
    int i;

    char[] cs = new char[] { ' ' };

    public Scanner()
    {
        s = new string[0];
        i = 0;
    }

    public string next()
    {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        if (s.Length == 0) return next();
        i = 0;
        return s[i++];
    }

    public int nextInt()
    {
        return int.Parse(next());
    }
    public int[] ArrayInt(int N, int add = 0)
    {
        int[] Array = new int[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextInt() + add;
        }
        return Array;
    }

    public long nextLong()
    {
        return long.Parse(next());
    }

    public long[] ArrayLong(int N, long add = 0)
    {
        long[] Array = new long[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextLong() + add;
        }
        return Array;
    }

    public double nextDouble()
    {
        return double.Parse(next());
    }

    public double[] ArrayDouble(int N, double add = 0)
    {
        double[] Array = new double[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextDouble() + add;
        }
        return Array;
    }
}


/*
У вас есть два друга. Вы хотите подарить каждому другу некоторое количество целых положительных чисел. Первому другу вы хотите подарить cnt1 чисел, второму — cnt2 чисел. Более того, вы хотите, чтобы все подаренные числа были различными, в частности, ни одно число не должно достаться обоим друзьям.

Кроме этого, первый друг не любит числа, которые делятся без остатка на простое число x. Второй друг не любит числа, которые делятся без остатка на простое число y. Конечно, вы не будете дарить друзьям числа, которые они не любят.

Ваша задача — найти такое минимальное число v, такое что из набора чисел 1, 2, ..., v можно составить подарки друзьям. Естественно, некоторые числа можно не дарить никому из них.

Положительное целое число, большее единицы, называется простым, если оно не делится нацело ни на одно положительное целое число кроме единицы и себя самого.
Входные данные

В первой строке записано четыре целых положительных числа cnt1, cnt2, x, y (1 ≤ cnt1, cnt2 < 109; cnt1 + cnt2 ≤ 109; 2 ≤ x < y ≤ 3·104) — описанные в условии числа. Гарантируется, что числа x, y являются простыми числами.
Выходные данные

Выведите единственное целое число — ответ на задачу.*/
using System;

namespace _483B
{
    class Program
    {
        private static long HigherDividend(long x, long diveder)
        {
            if (x%diveder == 0)
                return x;
            if (x < diveder)
                return 0;
            var left = x - diveder;
            var right = x;
            var middle = (left + right)/2;
            while (middle%diveder != 0)
            {
                if (middle/diveder < x/diveder)
                    left = middle;
                else
                    right = middle;
                middle = (left + right)/2;
            }
            return middle;
        }

        static void Main(string[] args)
        {
            var input = Console.ReadLine().Split(' ');
            var cnt1 = long.Parse(input[0]);
            var cnt2 = long.Parse(input[1]);
            var x = long.Parse(input[2]);
            var y = long.Parse(input[3]);

            long count = 0;
            long barrier = cnt1 + cnt2;
            while (count != cnt1 + cnt2)
            {
                long bad = HigherDividend(barrier, x*y)/(x*y);
                long xCountCommon = HigherDividend(barrier, y) / y - bad;
                long yCountCommon = HigherDividend(barrier, x) / x - bad;
                long xCount = Math.Min(xCountCommon, cnt1);
                long yCount = Math.Min(yCountCommon, cnt2);
                if (xCount < xCountCommon)
                    bad += xCountCommon - xCount;
                if (yCount < yCountCommon)
                    bad += yCountCommon - yCount;
                long good = barrier - bad - xCount - yCount;
                count = good + xCount + yCount;
                barrier += cnt1 + cnt2 - count;
            }

            Console.Write(barrier);
        }
    }
}


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

namespace lab11
{
    using li = System.Int64;
    using mt = System.Int64;
    class Program
    {
        const int N = 100 + 5;
        public static li INF = 1000000000000000;
        static li[,] mt = new li[N, N];

        static int n;
        static int[] a = new int[N];
        static li T;
        static mt[,] d = new mt[N,N];
        static mt[,] dt = new mt[N,N];

        static void Main(string[] args)
        {
            int[] input = Console.ReadLine().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(p => int.Parse(p)).ToArray<int>();
            n = input[0];
            T = input[1];
            input = Console.ReadLine().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(p => int.Parse(p)).ToArray<int>();
            for (int i = 0; i < n; ++i)
                a[i] = input[i];
            for (int s = 0; s < n; ++s)
            {
                for (int i = 0; i < n; ++i)
                {
                    if (a[i] < a[s])
                    {
                        d[s, i] = -INF;
                    }
                    else
                    {
                        d[s, i] = 1;
                        for (int j = 0; j < i; ++j)
                            if (a[j] <= a[i])
                                d[s, i] = Math.Max(d[s, i], d[s, j] + 1);
                    }
                }
            }
            binpow(d, T, dt);
            li res = 0;
            for (int i = 0; i < n; ++i)
                for (int j = 0; j < n; ++j)
                    res = Math.Max(res, dt[i, j]);
            Console.WriteLine(res);
        }

        static void one(mt[,] a)
        {
            for (int i = 0; i < n; ++i)
                for (int j = 0; j < n; ++j)
                    a[i,j] = 0;
        }

        static void copy(mt[,] a, mt[,] b)
        {
            for (int i = 0; i < n; ++i)
                for (int j = 0; j < n; ++j)
                    b[i, j] = a[i, j];
        }

        static void mul(mt[,] a, mt[,] b, mt[,] c)
        {
            for (int i = 0; i < n; ++i)
                for (int j = 0; j < n; ++j) {
                    c[i,j] = -INF;
                    for (int k = 0; k < n; ++k)
                        c[i,j] = Math.Max(c[i,j], a[i,k] + b[k,j]);
                }
        }

        static mt[,] t = new mt[N, N];
        static mt[,] r = new mt[N, N];

        static void binpow(mt[,] a, li b, mt[,] c)
        {
            copy(a, t);
            one(c);
            while (b != 0) {
                if ((b & 1) != 0) {
                    mul(c, t, r);
                    copy(r, c);
                }
                mul(t, t, r);
                copy(r, t);
                b >>= 1;
            }
        }
    }
}