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

class Program
{
    public static int[] Read(string str)
    {
        string[] tokens = str.Trim().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
        int[] ret = new int[tokens.Length];
        for (int i = 0; i < ret.Length; i++)
        {
            ret[i] = int.Parse(tokens[i]);
        }

        return ret;
    }

    public static long[] ReadLong(string str)
    {
        string[] tokens = str.Trim().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
        long[] ret = new long[tokens.Length];
        for (int i = 0; i < ret.Length; i++)
        {
            ret[i] = long.Parse(tokens[i]);
        }

        return ret;
    }

    public static double[] ReadDouble(string str)
    {
        string[] tokens = str.Trim().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
        double[] ret = new double[tokens.Length];
        for (int i = 0; i < ret.Length; i++)
        {
            ret[i] = double.Parse(tokens[i], CultureInfo.InvariantCulture);
        }

        return ret;
    }

    static string Reverse(string s)
    {
        char[] a = s.ToCharArray();
        Array.Reverse(a);
        return new string(a);
    }

    static bool IsPrime(int n)
    {
        if (n % 2 == 0) return false;

        int lim = (int)Math.Sqrt(n);
        for (int i = 3; i <= lim; i += 2)
        {
            if (n % i == 0) return false;
        }
        return true;
    }

    static void Main(string[] args)
    {
        int[] nk = Read(Console.ReadLine());
        int n = nk[0], k = nk[1];

        bool[] prime_mask = new bool[n + 1];
        List<int> primes = new List<int>();

        for (int i = 2; i <= n; i++)
        {
            if (IsPrime(i))
            {
                primes.Add(i);
                prime_mask[i] = true;
            }
        }

        bool[] flag = new bool[n + 1];
        for (int i = 0; i < primes.Count - 1; i++)
        {
            int sum = primes[i] + primes[i + 1] + 1;
            if (sum <= n && prime_mask[sum])
            {
                flag[sum] = true;
            }
        }
        int count = 0;
        for (int i = 0; i <= n; i++)
        {
            if (flag[i]) count++;
        }
        Console.WriteLine((count >= k) ? "YES" : "NO");
    }
}


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

//namespace ConsoleApplication1
//{
//    class Program
//    {

//        static void Main(string[] args)
//        {
//            int A = Int32.Parse(Console.ReadLine());
//            List<int> Values = new List<int>();
//            for (int i = 2; i < A; i++)
//            {
//                int baseN = i;
//                List<int> subValues = new List<int>();
//                int val = A;
//                while (val > 0)
//                {
//                    int maxPow = (int) Math.Log(val, baseN);
//                    for (int j = maxPow; j >= 0; j--)
//                    {

//                    }
//                }

//                Values.Add(subValues.Sum());
//            }

//            Console.WriteLine(Values.Sum()+"/"+Values.Count);
//        }
//    }

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

namespace ConsoleApplication1
{
    class Program
    {

        static void Main(string[] args)
        {
            string reader = Console.ReadLine();
            int links = reader.Where(x => x == '-').Count();
            int pearls = reader.Where(x => x == 'o').Count();
            bool output = false;

            if (links == 0 || pearls < 2) output = true;
            else
            {
                output = links % pearls == 0;
            }

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

        static bool valueInBetween (double d, int min, double max)
        {
            return d>=min&&d<=max;
        }
        static void Problem1245A()
        {
            byte t = byte.Parse(Console.ReadLine());
            for (byte i = 0; i < t; i++)
            {
                UInt16 a, b;
                UInt16[] reader = Console.ReadLine().Split(' ').Select(x => UInt16.Parse(x)).ToArray();
                a = reader[0]; b = reader[1];
                FindAnswer(a, b);
            }
        }
        static void FindAnswer(UInt16 a, UInt16 b)
        {
            string output = "";

            Console.WriteLine(output);
        }
    }

}


using System;
using System.Text;

namespace CodeForceTest
{
    class Program
    {
        static void Main(string[] args)
        {
            string string1 = Console.ReadLine().ToLower(), string2 = Console.ReadLine().ToLower();

            if (string.Compare(string1, string2) > 0) Console.Write(1);
            else if (string.Compare(string1, string2) < 0) Console.Write(-1);
            else if (string.Compare(string1, string2) == 0) Console.Write(0);

            Console.ReadLine();
        }
    }
}


using System;

namespace codeforcespst
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string[] days = Console.ReadLine().Split(' ');
            if (int.Parse(days[n - 1]) == 0)
                Console.WriteLine("UP");
            else if (int.Parse(days[n - 1]) == 15)
                Console.WriteLine("DOWN");
            else if (days.Length == 1)
                Console.WriteLine("-1");
            else if (int.Parse(days[n - 1]) > int.Parse(days[n - 2]))
                Console.WriteLine("UP");
            else
                Console.WriteLine("DOWN");
        }
    }
}


using System;
using System.Linq;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            int countA = s.Count(x => x == 'a');
            int result = 0;

            if (countA > s.Length / 2)
                result = s.Length;
            else
                result = countA + countA - 1;

            Console.WriteLine(result);
        }
    }
}


using System;
using System.Linq;

namespace A
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] positions = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();

            n /= 2;
            Array.Sort(positions);

            int ans = int.MaxValue;
            for (int x = 1; x <= 2; x++)
            {
                int cnt = 0;
                for (int i = 0; i < n; i++)
                {
                    int p = positions[i];
                    int q = x + i * 2;
                    cnt += Math.Abs(p - q);
                }
                ans = Math.Min(ans, cnt);
            }

            Console.WriteLine($"{ans}");
        }
    }
}


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

namespace ConsoleApplication4
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] dx = new int[4] { 0, -1, -1, -1 };
            int[] dy = new int[4] { -1, -1, 0, 1 };
            int[,] a = new int[233,233];
            for (int i = 0; i <= 222; i++)
            {
                for (int j = 0; j <= 222; j++)
                {
                    a[i, j] = -1;
                }
            }
                    for (int i=1; i<=4; i++) {
                for (int j=1; j<=4;j++) {
                    char c;
                    c = Convert.ToChar(Console.Read());
                    if (c == 'x') a[i, j] = 1;
                    if (c == '.') a[i, j] = 0;
                    //if (c == 'o') a[i, j] = -1;
                    }
                Console.ReadLine();
                }
            for (int i=1;i<=4;i++) {
                for (int j=1;j<=4;j++) {
                    for (int k=0;k<=3;k++)
                if ((a[i,j]+a[i+dx[k],j+dy[k]]+a[i-dx[k],j-dy[k]])>=2){
                            Console.Write("YES");
                            return;
                    }
                }
            }
            Console.WriteLine("NO");
        }
    }
}


#region Usings

using System;
using System.Linq;

#endregion

namespace A {
    internal class Program {
        private static void Main() {
            var n = Convert.ToInt32(Console.ReadLine());
            var sum = Console.ReadLine().Split(' ').Select(_ => Convert.ToInt32(_)).Sum();

            var res = 0;
            if ((sum + 1)%(n + 1) != 1) {
                res++;
            }
            if ((sum + 2)%(n + 1) != 1) {
                res++;
            }
            if ((sum + 3)%(n + 1) != 1) {
                res++;
            }
            if ((sum + 4)%(n + 1) != 1) {
                res++;
            }
            if ((sum + 5)%(n + 1) != 1) {
                res++;
            }

            Console.WriteLine(res);
        }
    }
}


using System;

namespace Codeforces395
{
    class Program
    {
        static void Main(string[] args)
        {
            var numbers = Console.ReadLine().Split(' ');
            var n = int.Parse(numbers[0]);
            var m = int.Parse(numbers[1]);
            var z = int.Parse(numbers[2]);

            var sum = 0d;
            for (var i = n; i <= z; i += n)
            {
                if (i % m == 0) sum++;
            }

            Console.WriteLine(sum);
        }
    }
}


using System;
using System.Collections.Generic;

namespace TestPrograms
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();

            string[] a = input.Split(' ');

            //int[] v = Array.ConvertAll(a, int.Parse);

            HashSet<int> c = new HashSet<int>();

            foreach (string s in a)
            {
                int t = int.Parse(s);
                if (!c.Contains(t))
                {
                    c.Add(t);
                }
            }

            Console.WriteLine(4 - c.Count);

        }
    }
}


using System;
namespace CodeForces {
    class Codigo {
        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]);
            int dist = Math.Abs(a) + Math.Abs(b);
            if (c < dist)
                Console.WriteLine("NO");
            else if ( ((dist - c) & 1) == 0 )
                Console.WriteLine("YES");
            else
                Console.WriteLine("NO");
        }
    }
}


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

public static class Beautiful_Year
{
    private static void Solve()
    {
        int year = ReadInt();
        for (int i = year + 1; i <= 9012; i++)
        {
            int distincts = i.ToString().Distinct().Count();
            if (distincts == 4)
            {
                year = i;
                break;
            }
        }

        Write(year);
    }

    #region Main

    private static TextReader reader;
    private static TextWriter writer;
    public static void Main()
    {
#if DEBUG
        //reader = new StreamReader("C:\\Users\\Axel\\Desktop\\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("input.txt");
        //writer = new StreamWriter("output.txt");
#endif
        try
        {
            Solve();
            //var thread = new Thread(new Beautiful_Year().Solve, 1024 * 1024 * 128);
            //thread.Start();
            //thread.Join();
        }
        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 Read() { while (currentLineTokens.Count == 0) currentLineTokens = new Queue<string>(ReadAndSplitLine()); return currentLineTokens.Dequeue(); }
    public static int ReadInt() { return int.Parse(Read()); }
    public static long ReadLong() { return long.Parse(Read()); }
    public static double ReadDouble() { return double.Parse(Read(), 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;
 class Program
    {
        public static void Main(string[] args)
        {
            string[] input = Console.In.ReadToEnd().Split(new char[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries);
            int index = 0;
            for(int i = 0; i < input[1].Length; ++i) if (input[0][index] == input[1][i]) index++;
            Console.WriteLine((index + 1));
        }
    }


using System;

public class ansa{
    public static void Main() {
        int n = Convert.ToInt32(Console.ReadLine());
        string pile = Console.ReadLine();
        int counter = 0;
        for(int i=0; i<n; i++) {
            if(counter>0 && pile[i]=='-') counter--;
            else if(pile[i]=='+') counter++;
        }
        Console.WriteLine(counter);
    }
}


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

namespace BulkaProga
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] lines = Console.ReadLine().Split(' ');
            int count = int.Parse(lines[0]);
            var puzzless = Console.ReadLine().Split(' ');
            var puzzles = new List<int>();
            foreach (var p in puzzless)
                puzzles.Add(int.Parse(p));
            puzzles.Sort();
            puzzles.Reverse();
            int min = int.MaxValue;
            for (int i = 0; i < puzzles.Count - count + 1; ++i)
            {
                var col = new List<int>();
                for (int j = 0; j < count; ++j)
                {
                    col.Add(puzzles[i + j]);
                }
                col.Sort();
                int val = col.Last() - col.First();
                if (val < min)
                    min = val;
            }
            Console.WriteLine(min);
        }
    }
}


using System;
using System.Linq;

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

             var n = int.Parse(Console.ReadLine());
            var arr = new int[n * n];
            for (int i = 0; i < n; i++)
            {
                arr[i] = 1;
            }
            for (int i = n; i < arr.Length; i += n)
            {
                arr[i] = 1;
            }

            for (int i = n + 1; i < arr.Length; ++i)
            {
                if (arr[i] != 1)
                {
                    arr[i] = arr[i - 1] + arr[i - n];
                }
            }

            Console.WriteLine(arr.Last());
        }

    }
}


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

namespace CF_Bear_and_Finding_Criminals
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] x = new string[2];
            x[0] = Console.ReadLine();
           // string [] x = System.IO.File.ReadAllLines(@"F:\CF.txt");
          //  string input = x[0];
           // int[] input = x[0].Split(' ').Select(int.Parse).ToArray();
            int[] input = StringToIntegers(x[0]);
            int NumberOfCities = input[0] - 1  ;
            int OfficerPosition = input[1] - 1 ;
            int count = 0 ;
            int condition;
             x[1] = Console.ReadLine() ;

            string Cities = x[1];
           Cities = RemoveSpaces(Cities, ' ');

           if (NumberOfCities / 2 < OfficerPosition)
               condition = OfficerPosition;
           else condition = NumberOfCities - OfficerPosition;
            for ( int i = 0 ; i<= condition ; i++ )
            {
                if (OfficerPosition - i >= 0 )
                {
                    if (OfficerPosition + i <= NumberOfCities)
                    {
                        if (Cities[OfficerPosition - i] == Cities[OfficerPosition + i] && Cities[OfficerPosition - i] == '1')
                        {
                            if (i != 0)
                                count += 2;
                            else count++;
                        }
                    }

                    else if (Cities[OfficerPosition - i] == '1')
                        count++;
                }
                else if (OfficerPosition + i <= NumberOfCities)
                {
                    if (Cities [OfficerPosition + i]== '1')
                    count += 1;
                }
            } // end for

            Console.WriteLine(count.ToString());
            Console.ReadLine();
        }

        static int[] StringToIntegers ( string S)
        {
            S = S + " ";
            string temp = "";
            int arrayCount = 0;
            int test ;
            int[] array = new int[100];
            for ( int i = 0 ; i < S.Length ; i++ )
            {
                if ( int.TryParse ( S[i].ToString() , out test ))
                    temp += S[i].ToString();
                else
                {

                    array[arrayCount++] = int.Parse(temp);
                    temp = "";
                }
            }
            return array;
        }
        static string RemoveSpaces (string input , char SpaceType )
        {
            string output = "";
            for (int i = 0 ; i< input.Length ; i++ )
            {
                if ( input[i] != SpaceType)
                    output+= input[i].ToString();
            }
            return output;

        }
    }
}


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

namespace ConsoleApplication44
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] nums = Console.ReadLine().Split().Select(e => Convert.ToInt32(e)).ToArray();

            int k = nums[0];
            int a = nums[1];
            int b = nums[2];
            int v = nums[3];

            int n = 1;
            while (true)
            {

                int m = b / n;

                int d = (b % n);
                if ((m + 1 <= k && d == 0) || m + 2 <= k)
                {
                    int cap = v * ((m + 1) * (n - d) + d * (m + 2));
                    if (cap >= a)
                        break;
                }
                else
                {
                    m = k - 1; d = 0;
                    int cap = v * ((m + 1) * (n - d) + d * (m + 2));
                    if (cap >= a)
                        break;

                }
                n++;
            }

            Console.WriteLine(n);
            Console.ReadLine();

        }
    }
}


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

namespace CFTraining.AimTech
{
    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 ProblemB
    {
        public static void Main(string[] args)
        {
            ConsoleScanner cs = new ConsoleScanner();
            int n = cs.NextInt();
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
            {
                a[i] = cs.NextInt();
            }
            a = a.OrderBy(x => x).ToArray();
            long len = 0;
            int prev = int.MaxValue;
            for (int i = n - 1; i >= 0; i--)
            {
                if (a[i] < prev)
                {
                    len += a[i];
                    prev = a[i];
                    if (prev == 1) break;
                }
                else
                {
                    len += prev - 1;
                    prev--;
                    if (prev == 1) break;
                }
            }
            Console.WriteLine(len);
        }
    }
}


using System;

class Program
{
    static void Main(string[] args)
    {
        string input  = Console.ReadLine();
        string vowels = "aeyiou";
        string result = "";
        input         = input.ToLower();
        foreach (var letter in input)
            if(!vowels.Contains(letter.ToString()))
                result += "." + letter;
        Console.WriteLine(result);
    }
}


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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(':');
            int HH = int.Parse(input[0]);
            int MM = int.Parse(input[1]);

            if(HH>=12)HH-=12;
            Console.Write((HH*30)+(MM/2));
            if (MM % 2 == 1) Console.Write(".5");
            Console.Write(" "+MM*6);
         //   Console.ReadLine();
        }
    }
}


using System;

namespace CodeForces
{
    class Program
    {
        public static void Main()
        {
            var m = GetInt();
            var s = GetInt();

            var max_s = s;
            var max_nums = new int[m];

            for (int i = 0; i < m; i++)
            {
                var num = (max_s < 9) ? max_s : 9;
                max_s -= num;
                max_nums[i] = num;
            }

            var min_s = s - 1;
            var min_nums = new int[m];

            for (int i = m - 1; i >= 0; i--)
            {
                if (i == 0)
                {
                    var num = (min_s < 8) ? min_s : 8;
                    min_s -= num;
                    min_nums[i] = num + 1;
                }
                else
                {
                    var num = (min_s < 9) ? min_s : 9;
                    min_s -= num;
                    min_nums[i] = num;
                }
            }

            if (m > 1 && s == 0)
            {
                Console.Write("-1 -1");
            }
            else if (max_s > 0 || min_s > 0)
            {
                Console.Write("-1 -1");
            }
            else
            {
                Console.Write("{0} {1}",
                    string.Join("", min_nums),
                    string.Join("", max_nums));
            }
        }

        private static int GetInt()
        {
            int ch = Console.Read();

            while (ch < '0' || ch > '9')
            {
                ch = Console.Read();
            }

            int current = 0;
            while (ch >= '0' && ch <= '9')
            {
                current = (current * 10) + (ch - '0');
                ch = Console.Read();
            }

            return current;
        }
    }
}


using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Numerics;
using System.Text;
using System.Text.RegularExpressions;
using System.Linq;
using System.IO;
public class CodeForces
{
#if TEST
    // To set this go to Project -> Properties -> Build -> General -> Conditional compilation symbols: -> enter 'TEST' into text box.
    const bool testing = true;
#else
const bool testing = false;
#endif

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

    static long modular_pow(long bases, long exponent, long modulus)
    {
        if (modulus == 1)
        {
            return 0;
        }
        long result = 1;
        bases = bases % modulus;
        while (exponent > 0)
        {
            if (exponent % 2 == 1)
            {
                result = (result * bases) % modulus;
            }
            exponent = exponent >> 1;
            bases = (bases * bases) % modulus;
        }
        return result;
    }
    static void program(TextReader input)
    {
        //var n = int.Parse(input.ReadLine().TrimEnd());
        var data = input.ReadLine().Split(' ').Select(long.Parse).ToList();
        var n = data[0];
        var m = data[1];
        var k = data[2];
        var mod = 1000000007;

        if(n%2 != m % 2 && k==-1)
        {
            writer.WriteLine(0);
            writer.Flush();
            return;
        }

        writer.WriteLine(modular_pow(modular_pow(2, ((n-1)), mod), (m - 1) , mod));
        writer.Flush();
    }

    public static void Main(string[] args)
    {
        if (!testing)
        { // set testing to false when submiting to codeforces
            program(Console.In); // write your program in 'program' function (its your new main !)
            return;
        }

        Console.WriteLine("Test Case(1) => expected :");
        Console.WriteLine("1\n");
        Console.WriteLine("Test Case(1) => found    :");
        program(new StringReader("1 1 -1\n"));
        Console.WriteLine();
        Console.ReadLine();

        Console.WriteLine("Test Case(2) => expected :");
        Console.WriteLine("1\n");
        Console.WriteLine("Test Case(2) => found    :");
        program(new StringReader("1 3 1\n"));
        Console.WriteLine();
        Console.ReadLine();

        Console.WriteLine("Test Case(3) => expected :");
        Console.WriteLine("16\n");
        Console.WriteLine("Test Case(3) => found    :");
        program(new StringReader("3 3 -1\n"));
        Console.WriteLine();
        Console.ReadLine();

    }
}


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

namespace Dreamoon_and_Sums
{
    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)
        {
            const long mod = 1000000007;
            long a = Next();
            long b = Next();

            long sum = 0;
            for (long i = 1; i < b; i++)
            {
                long count = a;
                long b0 = (i*b + i)%mod;
                sum += (count * b0) % mod + ((((count - 1) * count / 2) % mod * i) % mod * b) % mod;
                sum = sum%mod;
            }

            writer.WriteLine(sum%mod);
            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 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;
using System.Linq;

class Program
{
    static void Main(string[] args)
    {
        Console.ReadLine();
        Console.WriteLine(Console.ReadLine().Split(new char[] {' '}, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).Where(x => x != 0).Distinct().Count());
    }
}


//A. BracketSequence
#define TRYx

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

public class Parallelepiped
{
  public static void Main ( )
  {
#if TRY
    Console.SetIn ( new StringReader ( "1 1 1" ) );
    solve ( );
    Console.SetIn ( new StringReader ( "66 174 319" ) );

#endif
    solve ( );
    //Console.WriteLine ( solve ( ) );
  }

  private static void solve( )
  {
    int[] ii = ReadLineToInts ( );
    double X=ii[0];
    double Y=ii[1];
    double Z=ii[2];

    double ans=0;
    int a=-1;
    int b=-1;
    int c;

    for ( c = 1; c <= 10000; c++ )
    {
      X = ii[0]; Y = ii[1]; Z = ii[2];
      if ( Check ( X, Y, Z, c, out a, out b ) )
        break;
      X = ii[1]; Y = ii[0]; Z = ii[2];
      if ( Check ( X, Y, Z, c, out a, out b ) )
        break;
      X = ii[1]; Y = ii[2]; Z = ii[0];
      if ( Check ( X, Y, Z, c, out a, out b ) )
        break;
      X = ii[2]; Y = ii[0]; Z = ii[1];
      if ( Check ( X, Y, Z, c, out a, out b ) )
        break;
      X = ii[2]; Y = ii[1]; Z = ii[0];
      if ( Check ( X, Y, Z, c, out a, out b ) )
        break;

      continue;
    }
    ans = ( a + b + c ) * 4;

    Console.WriteLine ( ans );
  }

  static bool Check ( double X, double Y, double Z, int c, out int a, out int b)
  {
    a = -1;
    b = -1;
    double sumabc = ( X / Y + X / Z + 1 ) * c;
    if ( sumabc - ( int ) sumabc == 0 )
    {
      a = ( int ) Z / c;
      b = ( int ) Y / c;
      if ( ( int ) Z % c == 0 && ( int ) Y % c == 0 && sumabc == ( a + b + c ) )
        return true;
    }
    return false;
  }

  public static int[] ReadLineToInts ( )
  {
    string line = Console.ReadLine ( );
    string[] arStrings = line.Split ( new char[] { ' ' } );

    int N = arStrings.Length;
    int[] ints = new int[N];
    for ( int i=0; i < N; i++ )
      ints[i] = int.Parse ( arStrings[i] );
    return ints;
  }

}


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

namespace CodeforcesTemplate
{
    public static class Permutation
    {
        private static bool Next(ref int[] arr)
        {
            int k, j, l;
            for (j = arr.Length - 2; (j >= 0) && (arr[j] >= arr[j + 1]); j--) { }
            if (j == -1)
            {
                arr = arr.OrderBy(c => c).ToArray();
                return false;
            }
            for (l = arr.Length - 1; (arr[j] >= arr[l]) && (l >= 0); l--) { }
            var tmp = arr[j];
            arr[j] = arr[l];
            arr[l] = tmp;
            for (k = j + 1, l = arr.Length - 1; k < l; k++, l--)
            {
                tmp = arr[k];
                arr[k] = arr[l];
                arr[l] = tmp;
            }
            return true;
        }
        public static IEnumerable<int[]> AllPermutations(int[] arr)
        {
            do yield return arr;
            while (Next(ref arr));
        }
    }

    class Program
    {
        private const string FILENAME = "distance4";

        private const string INPUT = FILENAME + ".in";

        private const string OUTPUT = FILENAME + ".out";

        private static Stopwatch _stopwatch = new Stopwatch();

        private static StreamReader _reader = null;
        private static StreamWriter _writer = null;

        private static string[] _curLine;
        private static int _curTokenIdx;

        private static char[] _whiteSpaces = new char[] { ' ', '\t', '\r', '\n' };

        private static string ReadNextToken()
        {
            if (_curTokenIdx >= _curLine.Length)
            {
                //Read next line
                string line = _reader.ReadLine();
                if (line != null)
                    _curLine = line.Split(_whiteSpaces, StringSplitOptions.RemoveEmptyEntries);
                else
                    _curLine = new string[] { };
                _curTokenIdx = 0;
            }

            if (_curTokenIdx >= _curLine.Length)
                return null;

            return _curLine[_curTokenIdx++];
        }

        private static int ReadNextInt()
        {
            return int.Parse(ReadNextToken());
        }

        private static void RunTimer()
        {
#if (DEBUG)

            _stopwatch.Start();

#endif
        }

        private static void Main(string[] args)
        {

#if (DEBUG)
            double before = GC.GetTotalMemory(false);
#endif

            int k = int.Parse(Console.ReadLine());
            int i = 1;
            int currentK = 0;

            while (i < int.MaxValue)
            {
                int sum = 0;

                string str = i.ToString();

                for (var j = 0; j < str.Length; j++)
                {
                    sum += (str[j] - '0');
                    if (sum > 10)
                    {
                        break;
                    }
                }

                if (sum == 10)
                {
                    currentK++;

                    if (currentK == k)
                    {
                        Console.WriteLine(str);
                        break;
                    }

                    i = i + 9;
                }

                else
                {
                    i++;
                }
            }

#if (DEBUG)
            _stopwatch.Stop();

            double after = GC.GetTotalMemory(false);

            double consumedInMegabytes = (after - before) / (1024 * 1024);

            Console.WriteLine($"Time elapsed: {_stopwatch.Elapsed}");

            Console.WriteLine($"Consumed memory (MB): {consumedInMegabytes}");

            Console.ReadKey();
#endif

        }

        private static int CountLeadZeros(string source)
        {
            int countZero = 0;

            for (int i = source.Length - 1; i >= 0; i--)
            {
                if (source[i] == '0')
                {
                    countZero++;
                }

                else
                {
                    break;
                }

            }

            return countZero;
        }

        private static string ReverseString(string source)
        {
            char[] reverseArray = source.ToCharArray();

            Array.Reverse(reverseArray);

            string reversedString = new string(reverseArray);

            return reversedString;
        }

        private static int[] CopyOfRange(int[] src, int start, int end)
        {
            int len = end - start;
            int[] dest = new int[len];
            Array.Copy(src, start, dest, 0, len);
            return dest;
        }

        private static string StreamReader()
        {

            if (_reader == null)
                _reader = new StreamReader(INPUT);
            string response = _reader.ReadLine();
            if (_reader.EndOfStream)
                _reader.Close();
            return response;

        }

        private static void StreamWriter(string text)
        {

            if (_writer == null)
                _writer = new StreamWriter(OUTPUT);
            _writer.WriteLine(text);

        }

        private static int BFS(int start, int end, int[,] arr)
        {
            Queue<KeyValuePair<int, int>> queue = new Queue<KeyValuePair<int, int>>();
            List<bool> visited = new List<bool>();
            for (int i = 0; i < arr.GetLength(0); i++)
            {
                visited.Add(false);
            }

            queue.Enqueue(new KeyValuePair<int, int>(start, 0));
            KeyValuePair<int, int> node;
            int level = 0;
            bool flag = false;

            while (queue.Count != 0)
            {
                node = queue.Dequeue();
                if (node.Key == end)
                {
                    return node.Value;
                }
                flag = false;
                for (int i = 0; i < arr.GetLength(0); i++)
                {

                    if (arr[node.Key, i] == 1)
                    {
                        if (visited[i] == false)
                        {
                            if (!flag)
                            {
                                level = node.Value + 1;
                                flag = true;
                            }
                            queue.Enqueue(new KeyValuePair<int, int>(i, level));
                            visited[i] = true;
                        }
                    }
                }

            }
            return 0;

        }

        private static void Write(string source)
        {
            File.WriteAllText(OUTPUT, source);
        }

        private static string ReadString()
        {
            return File.ReadAllText(INPUT);
        }

        private static void WriteStringArray(string[] source)
        {
            File.WriteAllLines(OUTPUT, source);
        }

        private static string[] ReadStringArray()
        {
            return File.ReadAllLines(INPUT);
        }

        private static int[] GetIntArray()
        {
            return ReadString().Split(' ').Select(int.Parse).ToArray();
        }

        private static double[] GetDoubleArray()
        {
            return ReadString().Split(' ').Select(double.Parse).ToArray();
        }

        private static int[,] ReadINT2XArray(List<string> lines)
        {
            int[,] arr = new int[lines.Count, lines.Count];

            for (int i = 0; i < lines.Count; i++)
            {
                int[] row = lines[i].Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();

                for (int j = 0; j < lines.Count; j++)
                {
                    arr[i, j] = row[j];
                }
            }

            return arr;
        }
    }
}


using System;
class Program
{
    static void Main()
    {
        Console.ReadLine();
        int[] places = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
        Array.Sort(places);
        Console.WriteLine(places[places.Length - 1] - 25 < 0 ? 0 : places[places.Length - 1] - 25);
    }
}


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

namespace goodbye2015
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');
            if (s[2] == "month")
            {
                int ans = 0;
                int day = int.Parse(s[0]);
                if (day <= 29)
                {
                    Console.WriteLine(12);
                }
                else
                    if (day == 30)
                    {
                        Console.WriteLine(11);
                    }
                    else
                    {
                        Console.WriteLine(7);
                    }
            }
            else
            {
                int month = int.Parse(s[0]);
                if (month <= 3) Console.WriteLine(52);
                else
                    if (month == 4) Console.WriteLine(52);
                    else
                        if (month == 5) Console.WriteLine(53);
                        else
                            if (month == 6) Console.WriteLine(53);
                            else
                                Console.WriteLine(52);

            }
        }
    }
}


//#undef DEBUG

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

namespace codeforces
{
    class C
    {
        //  test
        static CodeforcesUtils CF = new CodeforcesUtils(
@"
10000 5000 5000 5000
");

        class Solver
        {
            public void Solve()
            {
                string[] ss = CF.ReadLine().Split(' ');
                int n = int.Parse(ss[0]);
                int a = int.Parse(ss[1]);
                int b = int.Parse(ss[2]);
                int c = int.Parse(ss[3]);

                int cmb=0;
                for (int i1 = 0; i1 <= c; i1++)
                {
                    int sum = i1 * 4;
                    if (sum > n*2)
                        break;

                    for (int i2 = 0; i2 <= b; i2++)
                    {
                        int sum2 = sum + (i2 * 2);

                        int tmp = n*2-sum2;
                        if (tmp > a)
                            continue;
                        if (tmp < 0)
                            break;

                        cmb++;

                        //Debug.WriteLine(i1 + " " + i2 + " " + tmp);
                    }
                }
                CF.WriteLine(cmb);

            }
        }

        #region test

        static void Main(string[] args)
        {
            System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("ru-RU");

            new Solver().Solve();
            CF.Close();
        }

        static void TLE()
        {
            for (; ; ) ;
        }

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

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

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

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

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

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

            string _test_input;

            List<string> _lines;

#if DEBUG
            public CodeforcesUtils(string test_input)
            {
                _test_input = test_input;
            }
#else

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

            public void Close()
            {
                if( _sr!= null)
                    _sr.Close();
                if( _sw != null)
                    _sw.Close();
            }

            System.IO.StreamReader _sr=null;
            System.IO.StreamWriter _sw=null;

        }

        #endregion
    }
}


using System;
using System.Collections.Generic;

namespace ConsoleApplication37
{
    class Program
    {
        static void Main(string[] args)
        {
            (new B_Solution()).SolveProblem();
        }
    }
    class B_Solution
    {
        public void SolveProblem()
        {
            Reader input = new Reader();
            int n = input.GiveNextElementInt();
            List<int> nuts_positions = new List<int>();
            for (int i = 0; i < n; i++)
            {
                int current_position = input.GiveNextElementInt();
                if (current_position == 1) nuts_positions.Add(i);
            }
            if (nuts_positions.Count == 0)
            {
                Console.WriteLine(0);
                Console.ReadLine();
                return;
            }
            long answer = 1;
            for (int i = 0; i < nuts_positions.Count - 1; i++)
                answer *= (nuts_positions[i + 1] - nuts_positions[i]);
            Console.WriteLine(answer);
            Console.ReadLine();
        }
    }
    class Reader
    {
        string[] elements;
        int position = -1;
        public string GiveNextElementString()
        {
            if (elements == null || position == elements.Length)
            {
                elements = Console.ReadLine().Split(' ');
                position = 1;
                return elements[position - 1];
            }
            else
            {
                position++;
                return elements[position - 1];
            }
        }
        public int GiveNextElementInt()
        {
            return int.Parse(GiveNextElementString());
        }
    }
}


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

namespace NetExperiment
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] kr = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
            int i = 1;
            while ((kr[0] * i) % 10 != kr[1] && (kr[0] * i) % 10 != 0) i++;
            Console.WriteLine(i);
        }
    }
}


using System;
using System.Linq;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = Convert.ToInt32(Console.ReadLine());
            int[] Ai = Console.ReadLine().Split().Select(x => Convert.ToInt32(x)).OrderByDescending(c => c).ToArray();
            Console.WriteLine(Solver(Ai,k));
        }

        public static int Solver(int[] Ai, int k)
        {
            if (k == 0)
                return 0;
            int sum = 0;
            for (int i = 0; i < Ai.Length; i++)
            {
                sum += Ai[i];
                if (sum >= k)
                    return i+1;
            }
            return -1;
        }
    }
}


#define ONLINE_JUDGE

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

class Program
{

    static int tests = 1;

#if (ONLINE_JUDGE)
    static TextReader r = Console.In;
    static TextWriter w = Console.Out;
#else
    static string path = @"C:\Y\Prog\Codeforces\194\";
    static string answerFile = "0{0}Answer.txt";
    static string resultFile = "0{0}Result.txt";
    static string sourceFile = "0{0}Source.txt";

    static TextReader r;
    static TextWriter w;
#endif

    static void Main(string[] args)
    {
        for (int i = 1; i <= tests; i++)
        {
#if (!ONLINE_JUDGE)
            r = new StreamReader(string.Format(path + sourceFile, i));
            w = new StreamWriter(string.Format(path + resultFile, i), false);
#endif
            int[] x = new int[8];
            int[] y = new int[8];
            for (int j = 0; j < 8; j++)
            {
                string[] buff = r.ReadLine().Split(' ');
                x[j] = Convert.ToInt32(buff[0]);
                y[j] = Convert.ToInt32(buff[1]);
            }
            solve(x,y);
            //w.Flush();
            //w.Dispose();
#if (!ONLINE_JUDGE)
            w.Flush(); w.Close();
            Console.WriteLine("CASE: {0}", i);
            string answer = File.ReadAllText(string.Format(path + answerFile, i));
            string result = File.ReadAllText(string.Format(path + resultFile, i));
            if (answer != result)
            {
                Console.WriteLine("FAIL:");
                Console.WriteLine("Result" + Environment.NewLine + result);
                Console.WriteLine("Answer" + Environment.NewLine + answer);
            }
            else
                Console.WriteLine("OK");
#endif
        }
    }

    public static void solve(int[] x, int[] y)
    {
        int[] xDiff = getDiff(x);
        int[] yDiff = getDiff(y);
        if (xDiff.Length != 3 || yDiff.Length != 3)
        {
            w.WriteLine("ugly");
            return;
        }
        for (int i = 0; i < xDiff.Length; i++)
            for (int j = 0; j < yDiff.Length; j++)
            {
                if (i == 1 && j == 1) continue;
                bool find = false;
                for (int k = 0; k  < x.Length; k ++)
                {
                    if (x[k] == xDiff[i] && y[k] == yDiff[j])
                        find = true;
                }
                if (!find)
                {
                    w.WriteLine("ugly");
                    return;
                }
            }
        w.WriteLine("respectable");

    }

    public static int[] getDiff(int[] x)
    {
        Dictionary<int, int> res = new Dictionary<int, int>();
        List<int> res2 = new List<int>();
        foreach(int i in x)
            if (!res.ContainsKey(i))
            {
                res.Add(i,i);
                res2.Add(i);
            }
        int[] res3 = res2.ToArray();
        Array.Sort(res3);
        return res3;
    }
}


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

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

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

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

			long b = long.Parse(input1);
			long g = long.Parse(input2);
			long n = long.Parse(input3);

			var maxBoys = Math.Min(b, n);
			var maxGirls = Math.Min(g, n);

			var minBoys = n - maxGirls;
			var minGirls = n - maxBoys;

			int count = 0;
			for (int i = 0; i < n + 1; i++)
			{
				var blue = i;
				var red = n - i;

				if (blue < minBoys || blue > maxBoys)
				{
					continue;
				}

				if (red < minGirls || red > maxGirls)
				{
					continue;
				}

				count++;
			}

			Console.WriteLine(count);
		}

		public class Team
		{
			public string Name { get; set; }

			public int Points { get; set; }

			public int GoalsFor { get; set; }

			public int GoalsAgainst { get; set; }
		}

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


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

namespace ConsoleApplication1
{
    class CanadaCup2
    {
        static void Main(string[] args)
        {
            //Console.SetIn(new StreamReader(@"D:\Sergey\Code\1.txt"));

            string ns = Console.ReadLine();
            ulong n = ulong.Parse(ns.Substring(0, ns.Length - 1));
            char s = ns[ns.Length - 1];
            int c = s - 'a';
            int[] d = new int[] { 3, 4, 5, 2, 1, 0 };
            ulong a = (n - 1) % 2;
            ulong b = (n - 1) / 4;
            //if (b > 1)
            //    b -= 2;

            ulong e = b * 16;
            if (a > 0)
                e+=7;
            e += (ulong)(d[c] + 1);

            Console.WriteLine(e);

        } // Main
    }
}


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

namespace ConsoleApplication4
{
	class Program
	{
		static void Main(string[] args)
		{
			String line;
			Int32 n;
			line = Console.ReadLine();
			n = Convert.ToInt32(line);
			Console.WriteLine(1.5 * n);
		}
	}
}


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;

namespace cf116b
{
    class MainClass
    {
        static int n;
        static int m ;
        public static void Main (string[] args)
        {
            string nm = Console.ReadLine();
            n = int.Parse ( nm.Split(' ')[0]);
            m = int.Parse ( nm.Split(' ')[1]);
            string data;
            char[][] field = new char[n][];
            for (int i = 0; i < n; i++) {
                data = Console.ReadLine();
                field[i] = data.ToCharArray();
            }

            int res = 0;
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; j++)
                {
                    int wi, wj;
                    if (field[i][j] == 'P' && WolfNeighbour(field,i,j,out wi,out wj)){
                        field[wi][wj] = '.';
                        res++;
                    }
                }
            }

            Console.WriteLine (res);
        }

        private static Boolean WolfNeighbour(char[][] arr, int i, int j, out int wi, out int wj)
        {
            if (j + 1 < m){
                if (arr[i][j+1] == 'W')
                {
                    wi=i;
                    wj=j+1;
                    return true;
                }
            }
            if (j -1 >= 0){
                if (arr[i][j-1] == 'W')
                {
                    wi=i;
                    wj=j-1;
                    return true;
                }
            }

            if (i + 1 < n){
                if (arr[i+1][j] == 'W')
                {
                    wi=i+1;
                    wj=j;
                    return true;
                }
            }

            if (i-1  >= 0){
                if (arr[i-1][j] == 'W')
                {
                    wi=i-1;
                    wj=j;
                    return true;
                }
            }

            wi=-1;
            wj=-1;
            return false;
        }
    }
}


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

class Program
{
    static void Main()
    {
        new Magatro().Solve();
    }
}

class Magatro
{
    private int A, B;
    private void Scan()
    {
        var line = Console.ReadLine().Split(' ');
        A = int.Parse(line[0]);
        B = int.Parse(line[1]);
    }

    public void Solve()
    {
        Scan();
        int ans = 1;
        for(int i = 1; i <= Math.Min(A, B); i++)
        {
            ans *= i;
        }
        Console.WriteLine(ans);
    }
}


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

public static partial class Program
{
	public static void InputProcessing()
	{
		int[] vars = ParseArray<int>();
		int a = vars[0];
		int b = vars[1];
		int c = vars[2];
		int d = vars[3];
		Console.WriteLine(DataProcessing(a, b, c, d));
	}

	public static string DataProcessing(int a, int b, int c, int d)
	{
		List<int> s = new List<int>();
		s.Add(Function(a, b, c));
		s.Add(Function(a, b, d));
		s.Add(Function(a, c, d));
		s.Add(Function(b, c, d));

		if (s.Max() == 2)
		{
			return "TRIANGLE";
		} else if (s.Max() == 1)
		{
			return "SEGMENT";
		} else
		{
			return "IMPOSSIBLE";
		}
	}

	public static int Function(int a, int b, int c)
	{
		if (a + b < c || b + c < a || a + c < b)
		{
			return 0; // "IMPOSSIBLE";
		} else if (a + b == c || b + c == a || a + c == b)
		{
			return 1; // "SEGMENT";
		} else
		{
			return 2; // "TRIANGLE";
		}
	}
}

public static partial class Program
{
	public static void Main(string[] args)
	{
		InputProcessing();
#if DEBUG
		Console.ReadLine();
#endif
	}

	public static T[] ParseArray<T>()
	{
		TypeConverter tc = TypeDescriptor.GetConverter(typeof(T));
		string[] input = Console.ReadLine().Split();
		T[] output = new T[input.Length];
		for (int i = 0; i < input.Length; i++) { output[i] = (T)tc.ConvertFromString(input[i]); }
		return output;
	}

	public static T[][] ParseMatrix<T>(int nrows)
	{
		T[][] rv = new T[nrows][];
		for (int i = 0; i < nrows; i++) { rv[i] = ParseArray<T>(); }
		return rv;
	}
}


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

namespace ProblemSolving.CodeForces
{
    class Polycarps
    {
        public static void Main(string[] args)
        {
            int a = int.Parse(Console.ReadLine());
            int[] arr = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int[] cnt = new int[200];
            cnt = cnt.Select(i => 0).ToArray();

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

            int maxValue = cnt.Max();
            Console.WriteLine(maxValue);
        }
    }
}


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

namespace deneme
{
    class Program
    {
       static void Main(string[] args)
        {
           try
            {
                string s = Console.ReadLine();
                int[] alph = new int[26];
                char letter = ' ';
                int counter = 0;
                for (int i = 0; i < s.Length; i++)
                {
                    letter = s[i];
                    alph[(int)letter - 97 ] = 1;

                }
                for (int i = 0; i < alph.Length; i++)
                {
                    if (alph[i] >= 1)
                        counter++;
                }
                if (counter % 2 == 0)
                    Console.Write("CHAT WITH HER!");
                else
                    Console.Write("IGNORE HIM!");

                Console.Read();
           }
         catch { }
        }
    }
}


using System;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Threading;
using static System.Console;

namespace task
{
    class Program
    {
        static void Main(string[] args)
        {
            var data =  ReadLine().Split(' ').Select(int.Parse);
            var n = data.ElementAt(0);
            var k = data.ElementAt(1);
            int ans = 0;

            if (k  % n == 0)
            {
                ans = k / n;
            }
            else
            {
                ans = k / n + 1;
            }

            Console.WriteLine(ans);

        }
    }
}


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

namespace SummerSchool
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());

            int digits = 1, count = 0, a = 1,b=9;

            while (count+b*digits<n)
            {
                count += b * digits;
                a *= 10;
                b *= 10;
                digits++;
            }

            n -= count;

            int number = a + n / digits;
            if (n % digits == 0) number--;

            n -= (number - a) * digits;

            for (int i = digits; i > n; i--) number /= 10;

            Console.Write(number % 10);
        }
    }
}


using System;
using System.Linq;
using CompLib.Util;
using System.Threading;
using System.IO;
using System.Collections.Generic;
using System.Text;
using CompLib.Mathematics;

public class Program
{
    int N;
    long M;

    ModInt[] C;

    List<int> Primes;
    bool[] IsPrime;
    public void Solve()
    {
        var sc = new Scanner();
        N = sc.NextInt();
        M = sc.NextLong();

        // GCD(A[i], i) = 1ならA[i]を消せる

        // 1 <= B[i] <= N-i+1 な配列B
        // B[i] i回目に消す要素

        // Bが複数考えられるAは何通りか?

        // 要素 1 <= A[i] <= M
        // 長さN

        // B = {1,1,1,1,1,1} のみ
        // 上以外ならOK

        // i番目
        // 1,2,3,4,...i とGCD=1な整数

        // 2番目以降 i
        // 2,3,4, ...iとGCD 1以外
        C = new ModInt[N + 1];
        C[1] = M;

        Primes = new List<int>();
        IsPrime = MathEx.Sieve(N, Primes);

        long lcm = 1;

        for (int i = 2; i <= N; i++)
        {
            if (lcm > M)
            {
                C[i] = 0;
            }
            else
            {
                if (IsPrime[i])
                {
                    lcm *= i;
                }
                C[i] = (M / lcm) % ModInt.Mod;
            }

        }
        // Console.WriteLine(String.Join(" ", C));

        ModInt ans = 0;
        ModInt all = 1;
        ModInt minus = 1;
        for (int i = 1; i <= N; i++)
        {
            all *= M % ModInt.Mod;
            minus *= C[i];

            ans += all - minus;
        }

        Console.WriteLine(ans);
    }

    public static void Main(string[] args) => new Program().Solve();
    // public static void Main(string[] args) => new Thread(new Program().Solve, 1 << 27).Start();
}

// https://bitbucket.org/camypaper/complib
namespace CompLib.Mathematics
{
    using System;
    using System.Collections.Generic;
    #region GCD LCM
    /// <summary>
    /// 様々な数学的関数の静的メソッドを提供します．
    /// </summary>
    public static partial class MathEx
    {
        /// <summary>
        /// 2 つの整数の最大公約数を求めます．
        /// </summary>
        /// <param name="n">最初の値</param>
        /// <param name="m">2 番目の値</param>
        /// <returns>2 つの整数の最大公約数</returns>
        /// <remarks>ユークリッドの互除法に基づき最悪計算量 O(log N) で実行されます．</remarks>
        public static int GCD(int n, int m) { return (int)GCD((long)n, m); }

        /// <summary>
        /// 2 つの整数の最大公約数を求めます．
        /// </summary>
        /// <param name="n">最初の値</param>
        /// <param name="m">2 番目の値</param>
        /// <returns>2 つの整数の最大公約数</returns>
        /// <remarks>ユークリッドの互除法に基づき最悪計算量 O(log N) で実行されます．</remarks>
        public static long GCD(long n, long m)
        {
            n = Math.Abs(n);
            m = Math.Abs(m);
            while (n != 0)
            {
                m %= n;
                if (m == 0) return n;
                n %= m;
            }
            return m;
        }

        /// <summary>
        /// 2 つの整数の最小公倍数を求めます．
        /// </summary>
        /// <param name="n">最初の値</param>
        /// <param name="m">2 番目の値</param>
        /// <returns>2 つの整数の最小公倍数</returns>
        /// <remarks>最悪計算量 O(log N) で実行されます．</remarks>
        public static long LCM(long n, long m) { return (n / GCD(n, m)) * m; }
    }
    #endregion
    #region PrimeSieve
    public static partial class MathEx
    {
        /// <summary>
        /// ある値までに素数表を構築します．
        /// </summary>
        /// <param name="max">最大の値</param>
        /// <param name="primes">素数のみを入れた数列が返される</param>
        /// <returns>0 から max までの素数表</returns>
        /// <remarks>エラトステネスの篩に基づき，最悪計算量 O(N loglog N) で実行されます．</remarks>
        public static bool[] Sieve(int max, List<int> primes = null)
        {
            var isPrime = new bool[max + 1];
            for (int i = 2; i < isPrime.Length; i++) isPrime[i] = true;
            for (int i = 2; i * i <= max; i++)
                if (!isPrime[i]) continue;
                else for (int j = i * i; j <= max; j += i) isPrime[j] = false;
            if (primes != null) for (int i = 0; i <= max; i++) if (isPrime[i]) primes.Add(i);

            return isPrime;
        }
    }
    #endregion
}

// https://bitbucket.org/camypaper/complib
namespace CompLib.Mathematics
{
    #region ModInt
    /// <summary>
    /// [0,<see cref="Mod"/>) までの値を取るような数
    /// </summary>
    public struct ModInt
    {
        /// <summary>
        /// 剰余を取る値．
        /// </summary>
        // public const long Mod = (int)1e9 + 7;
        public const long Mod = 998244353;

        /// <summary>
        /// 実際の数値．
        /// </summary>
        public long num;
        /// <summary>
        /// 値が <paramref name="n"/> であるようなインスタンスを構築します．
        /// </summary>
        /// <param name="n">インスタンスが持つ値</param>
        /// <remarks>パフォーマンスの問題上，コンストラクタ内では剰余を取りません．そのため，<paramref name="n"/> ∈ [0,<see cref="Mod"/>) を満たすような <paramref name="n"/> を渡してください．このコンストラクタは O(1) で実行されます．</remarks>
        public ModInt(long n) { num = n; }
        /// <summary>
        /// このインスタンスの数値を文字列に変換します．
        /// </summary>
        /// <returns>[0,<see cref="Mod"/>) の範囲内の整数を 10 進表記したもの．</returns>
        public override string ToString() { return num.ToString(); }
        public static ModInt operator +(ModInt l, ModInt r) { l.num += r.num; if (l.num >= Mod) l.num -= Mod; return l; }
        public static ModInt operator -(ModInt l, ModInt r) { l.num -= r.num; if (l.num < 0) l.num += Mod; return l; }
        public static ModInt operator *(ModInt l, ModInt r) { return new ModInt(l.num * r.num % Mod); }
        public static implicit operator ModInt(long n) { n %= Mod; if (n < 0) n += Mod; return new ModInt(n); }

        /// <summary>
        /// 与えられた 2 つの数値からべき剰余を計算します．
        /// </summary>
        /// <param name="v">べき乗の底</param>
        /// <param name="k">べき指数</param>
        /// <returns>繰り返し二乗法により O(N log N) で実行されます．</returns>
        public static ModInt Pow(ModInt v, long k) { return Pow(v.num, k); }

        /// <summary>
        /// 与えられた 2 つの数値からべき剰余を計算します．
        /// </summary>
        /// <param name="v">べき乗の底</param>
        /// <param name="k">べき指数</param>
        /// <returns>繰り返し二乗法により O(N log N) で実行されます．</returns>
        public static ModInt Pow(long v, long k)
        {
            long ret = 1;
            for (k %= Mod - 1; k > 0; k >>= 1, v = v * v % Mod)
                if ((k & 1) == 1) ret = ret * v % Mod;
            return new ModInt(ret);
        }
        /// <summary>
        /// 与えられた数の逆元を計算します．
        /// </summary>
        /// <param name="v">逆元を取る対象となる数</param>
        /// <returns>逆元となるような値</returns>
        /// <remarks>法が素数であることを仮定して，フェルマーの小定理に従って逆元を O(log N) で計算します．</remarks>
        public static ModInt Inverse(ModInt v) { return Pow(v, Mod - 2); }
    }
    #endregion
    #region Binomial Coefficient
    public class BinomialCoefficient
    {
        public ModInt[] fact, ifact;
        public BinomialCoefficient(int n)
        {
            fact = new ModInt[n + 1];
            ifact = new ModInt[n + 1];
            fact[0] = 1;
            for (int i = 1; i <= n; i++)
                fact[i] = fact[i - 1] * i;
            ifact[n] = ModInt.Inverse(fact[n]);
            for (int i = n - 1; i >= 0; i--)
                ifact[i] = ifact[i + 1] * (i + 1);
            ifact[0] = ifact[1];
        }
        public ModInt this[int n, int r]
        {
            get
            {
                if (n < 0 || n >= fact.Length || r < 0 || r > n) return 0;
                return fact[n] * ifact[n - r] * ifact[r];
            }
        }
        public ModInt RepeatedCombination(int n, int k)
        {
            if (k == 0) return 1;
            return this[n + k - 1, k];
        }
    }
    #endregion
}

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;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System.Globalization;
using System.Threading;
using System.Linq;

class TEST{
	static void Main(){
		var S=Console.ReadLine();

		bool chk=true;
		//1
		if(S.Length<5)chk=false;
		//2,3,4
		bool chk2=false;
		for(int i=0;i<S.Length;i++){
			if(S[i]>='A' && S[i]<='Z')chk2=true;
		}
		chk=chk&chk2;
		chk2=false;
		for(int i=0;i<S.Length;i++){
			if(S[i]>='a' && S[i]<='z')chk2=true;
		}
		chk=chk&chk2;
		chk2=false;
		for(int i=0;i<S.Length;i++){
			if(S[i]>='0' && S[i]<='9')chk2=true;
		}
		chk=chk&chk2;

		Console.WriteLine(chk?"Correct":"Too weak");

	}
}


using System;
using System.Linq;

namespace trenvk
{
    class Program
    {
        static long nb, ns, nc, needB, needS, needC, pb, ps, pc, rub;

        static void Main(string[] args)
        {
            string Str = Console.ReadLine();
            long[] n = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
            long[] p = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
            rub = long.Parse(Console.ReadLine());

            needB = 0; needS = 0; needC = 0;
            nb = n[0]; ns = n[1]; nc = n[2];
            pb = p[0]; ps = p[1]; pc = p[2];

            for(int i = 0; i < Str.Length; i++)
            {
                switch (Str[i])
                {
                    case 'B':
                        needB++;
                        break;
                    case 'C':
                        needC++;
                        break;
                    case 'S':
                        needS++;
                        break;
                }
            }

            long l = 0;
            long r = 100000000000000;
            while(l < r)
            {
                long m = (r + l) / 2;
                if (check(m)) l = m + 1;
                else r = m;
            }
            Console.WriteLine(l - 1);
        }

        static bool check(long n)
        {
            long PriceB = Math.Max(0, (needB * n - nb) * pb);
            long PriceS = Math.Max(0, (needS * n - ns) * ps);
            long PriceC = Math.Max(0, (needC * n - nc) * pc);
            long sum = PriceB + PriceS + PriceC;
            return PriceB + PriceS + PriceC <= rub;
        }
    }
}


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

namespace _577A_Multiplication_Table
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] str = Console.ReadLine().Split();
            long n = long.Parse(str[0]);
            long x = long.Parse(str[1]);
            int counter = 0;

            for (long i = 1; i <= n; i++)
            {
                if (x % i == 0 && x <= n * i)
                    counter++;
            }

            Console.WriteLine(counter.ToString());
            Console.ReadLine();
        }
    }
}


using System;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using static System.Console;
using static System.Math;

namespace Olymp
{
  public class ProblemSolver
  {
    private readonly Tokenizer input;

    public void Solve()
    {
      var q1x = new int[4];
      var q1y = new int[4];
      var q2x = new int[4];
      var q2y = new int[4];
      for (var i = 0; i < 4; i++)
      {
        q1x[i] = input.ReadInt();
        q1y[i] = input.ReadInt();
      }
      for (var i = 0; i < 4; i++)
      {
        q2x[i] = input.ReadInt();
        q2y[i] = input.ReadInt();
      }
      var x1min = q1x.Min();
      var y1min = q1y.Min();
      var x1max = q1x.Max();
      var y1max = q1y.Max();
      var x2min = q2x.Min();
      var y2min = q2y.Min();
      var x2max = q2x.Max();
      var y2max = q2y.Max();
      var d = (x2max - x2min) / 2;
      for (var x = Max(x1min, x2min); x <= Min(x1max, x2max); x++)
      {
        for (var y = Max(y1min, y2min); y <= Min(y1max, y2max); y++)
        {
          if (x >= x1min && x <= x1max &&
              y >= y1min && y <= y1max &&
              x >= x2min && x <= x2max &&
              y >= y2min && y <= y2max)
          {
            var x0 = x - x2min - d;
            var y0 = y - y2min - d;
            if (x0 + y0 <= d &&
                x0 + y0 >= -d &&
                y0 - x0 <= d &&
                y0 - x0 >= -d)
            {
              Write("YES");
              return;
            }
          }
        }
      }
      Write("NO");
    }

    public ProblemSolver(TextReader input)
    {
      this.input = new Tokenizer(input);
    }
  }

  #region Service classes

  public class Tokenizer
  {
    private readonly TextReader reader;

    public string ReadToEnd()
    {
      return reader.ReadToEnd();
    }

    public int ReadInt()
    {
      var c = SkipWS();
      if (c == -1)
        throw new EndOfStreamException();
      var isNegative = false;
      if (c == '-' || c == '+')
      {
        isNegative = c == '-';
        c = reader.Read();
        if (c == -1)
          throw new EndOfStreamException("Digit expected, but end of stream occurs");
      }
      if (!char.IsDigit((char)c))
        throw new InvalidOperationException($"Digit expected, but was: '{(char)c}'");
      var result = (char)c - '0';
      c = reader.Read();
      while (c > 0 && !char.IsWhiteSpace((char)c))
      {
        if (!char.IsDigit((char)c))
          throw new InvalidOperationException($"Digit expected, but was: '{(char)c}'");
        result = result * 10 + (char)c - '0';
        c = reader.Read();
      }
      if (isNegative)
        result = -result;
      return result;
    }

    public string ReadLine()
    {
      return reader.ReadLine();
    }

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

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

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

    public (int, int) Read2Int() =>
      (ReadInt(), ReadInt());

    public (int, int, int) Read3Int() =>
      (ReadInt(), ReadInt(), ReadInt());

    public (int, int, int, int) Read4Int() =>
      (ReadInt(), ReadInt(), ReadInt(), ReadInt());

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

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

    public string ReadToken()
    {
      var c = SkipWS();
      if (c == -1)
        return null;
      var sb = new StringBuilder();
      while (c > 0 && !char.IsWhiteSpace((char)c))
      {
        sb.Append((char)c);
        c = reader.Read();
      }
      return sb.ToString();
    }

    private int SkipWS()
    {
      var c = reader.Read();
      if (c == -1)
        return c;
      while (c > 0 && char.IsWhiteSpace((char)c))
        c = reader.Read();
      return c;
    }

    public Tokenizer(TextReader reader)
    {
      this.reader = reader;
    }
  }

  internal class Program
  {
    public static void Main()
    {
      var solver = new ProblemSolver(In);
      solver.Solve();
    }
  }

  #endregion
}


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

namespace chatroom.cs
{
    class Program
    {
        static void Main()
        {
            int a = 0;
            int b = 0;
            int c = 0;
            int d = 0;
            int e = 0;

            string hlo = Console.ReadLine();
            for (int i = 0; i < hlo.Length; i++) { if (hlo[i] == 'h') { a = i; break; } }
            for (int j = a+1; j < hlo.Length; j++)
            {
                if (hlo[j] == 'e')
                {
                    b = j;

                        break;
                    }
                }

            for (int k = b+1; k < hlo.Length; k++)
            {
                if (hlo[k] == 'l')
                {
                    c = k;

                        for (int l = c+1; l < hlo.Length; l++)
                        {
                            if (hlo[l] == 'l')
                            {
                                d=l;

                                    break;

                                }
                    }
                    if (d != 0) {
                        break;
                            }
                        }

                    }

            for (int m = d+1; m < hlo.Length; m++)
            {
                if (hlo[m] == 'o')
                {
                    e = m;

                        break;
                    }
                }

            if ((a < b) && (b < c) && (c <= d) && (d < e)) { Console.WriteLine("YES"); }
            else { Console.WriteLine("NO"); }

        }
    }
}


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;

namespace Olymp
{
  class Heap<T>
  {
    SortedList<T, int> counter;
    public Heap(IEnumerable<T> collection)
    {
      counter = new SortedList<T, int>();
      foreach(var item in collection)
        Push(item);
    }
    public T PopMax()
    {
      int n = counter.Count;
      T k = counter.Keys[n - 1];
      if (counter.Values[n - 1] == 1)
        counter.RemoveAt(n - 1);
      else
        counter[k]--;
      return k;
    }
    public T GetMax()
    {
      return counter.Keys.Last();
    }
    public void Push(T item)
    {
      if (counter.ContainsKey(item))
        counter[item]++;
      else
        counter.Add(item, 1);
    }
  }

  public class ProblemSolver
  {
    public void Solve()
    {
      int n = int.Parse(Console.ReadLine());
      int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray();
      int m = a[0];
      int m0 = m;
      var s = new Heap<int>(a.Skip(1));
      while(s.GetMax() >= m)
      {
        s.Push(s.PopMax() - 1);
        m++;
      }
      Console.Write(m - m0);
    }
  }

  class Program
  {
    public static void Main(string[] args)
    {
      var solver = new ProblemSolver();
      solver.Solve();
    }
  }
}


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

class PairVariable : IComparable<PairVariable>
{
    public int a, b;
    public PairVariable()
    {
        a = b = 0;
    }
    public PairVariable(string s)
    {
        string[] q = s.Split();
        a = int.Parse(q[0]);
        b = int.Parse(q[1]);
    }
    public PairVariable(int a, int b)
    {
        this.a = a;
        this.b = b;
    }
    public int CompareTo(PairVariable pv)
    {
        if (this.a > pv.a)
        {
            return 1;
        }
        else if (this.a < pv.a)
        {
            return -1;
        }
        else
        {
            if (this.b >= pv.b)
            {
                return 1;
            }
            else
            {
                return -1;
            }
        }
    }

}
namespace ConsoleApplication2
{

    class Program
    {

        static int[,] matrix;
        static int[] mark;

        static void DFS(int v)
        {

            mark[v] = 1;
            for (int i = 0; i < matrix.GetLength(0); i++)
            {

                if (matrix[v, i] == 1)
                {

                    if (mark[v] == 0)
                    {
                        DFS(i);
                    }
                }
            }

        }
        static bool IsPrime(int n)
        {
            for (int i = 2; i <= Math.Sqrt(n); i++)
            {
                if (n % i == 0)
                {
                    return false;
                }
            }
            return true;
        }
        static void IsYesNo(bool b)
        {
            if (b)
            {
                Console.WriteLine("YES");
            }
            else
            {
                Console.WriteLine("NO");
            }
        }
        static void Main(string[] args)
        {
            string[] ss = Console.ReadLine().Split();
            long t = long.Parse(ss[0]);
            long s = long.Parse(ss[1]);
            long k = long.Parse(ss[2]);
            if ((k - t) % s == 0 && k - t >= 0)
            {
                IsYesNo(true);
            }
            else if ((k-t-1)%s==0 && (k-t)/s>0)
            {
                IsYesNo(true);
            }
            else
            {
                IsYesNo(false);
            }

        }
    }
}


using System;

namespace CFDay8
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            if (s.Contains("H") || s.Contains("Q") || s.Contains("9") )
                Console.WriteLine("YES");
            else
                Console.WriteLine("NO");
        }
    }
}


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

class Program
{
    public static int[] Read(string str)
    {
        string[] tokens = str.Trim().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
        int[] ret = new int[tokens.Length];
        for (int i = 0; i < ret.Length; i++)
        {
            ret[i] = int.Parse(tokens[i]);
        }

        return ret;
    }

    public static double[] ReadDouble(string str)
    {
        string[] tokens = str.Trim().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
        double[] ret = new double[tokens.Length];
        for (int i = 0; i < ret.Length; i++)
        {
            ret[i] = double.Parse(tokens[i], CultureInfo.InvariantCulture);
        }

        return ret;
    }

    static string Reverse(string s)
    {
        char[] a = s.ToCharArray();
        Array.Reverse(a);
        return new string(a);
    }

    static void Main(string[] args)
    {
        string s = Console.ReadLine().Trim();

        HashSet<string> hs = new HashSet<string>();
        int x = 0;
        int y = 0;
        hs.Add(string.Format("{0},{1}", x, y));
        for (int i = 0; i < s.Length; i++)
        {
            string key_prev = string.Format("{0},{1}", x, y);
            if (s[i] == 'U') y--;
            else if (s[i] == 'D') y++;
            else if (s[i] == 'L') x--;
            else if (s[i] == 'R') x++;
            string key = string.Format("{0},{1}", x, y);
            string key_u = string.Format("{0},{1}", x, y - 1);
            string key_d = string.Format("{0},{1}", x, y + 1);
            string key_l = string.Format("{0},{1}", x - 1, y);
            string key_r = string.Format("{0},{1}", x + 1, y);
            if (hs.Contains(key))
            {
                Console.WriteLine("BUG");
                return;
            }
            if ((key_prev != key_u && hs.Contains(key_u)) ||
                (key_prev != key_d && hs.Contains(key_d)) ||
                (key_prev != key_l && hs.Contains(key_l)) ||
                (key_prev != key_r && hs.Contains(key_r)))
            {
                Console.WriteLine("BUG");
                return;
            }
            hs.Add(key);
        }
        Console.WriteLine("OK");
    }
}


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

class Codeforces {

    static void Main() {
        int n = int.Parse(Console.ReadLine());
        int a = int.Parse(Console.ReadLine());
        int b = int.Parse(Console.ReadLine());
        int c = int.Parse(Console.ReadLine());

        // 1-2      a
        // 1-3      b
        // 2-3      c

        int k = 0;
        int cur = 1;
        while (n-- > 1) {
            if (cur == 1) {
                if (a < b) { cur = 2; k += a; } else { cur = 3; k += b; }
            } else if (cur == 2) {
                if (a < c) { cur = 1; k += a; } else { cur = 3; k += c; }
            } else {
                if (b < c) { cur = 1; k += b; } else { cur = 2; k += c; }
            }
        }
        Console.WriteLine(k);

    }
}


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

namespace probleme {
    class Program {
        static void Main(string[] args) {
            //Console.SetIn(new StreamReader("file.txt"));
            int[] dp = new int[10000001];
            dp[0] = 6;
            dp[1] = 2;
            dp[2] = 5;
            dp[3] = 5;
            dp[4] = 4;
            dp[5] = 5;
            dp[6] = 6;
            dp[7] = 3;
            dp[8] = 7;
            dp[9] = 6;
            int ans = 0;
            string[] s = Console.ReadLine().Split(' ');
            int a = int.Parse(s[0]), b = int.Parse(s[1]);
            for (int i = a; i <= Math.Min(b, 9); i++) {
                ans += dp[i];
            }
            if (b > 10) {
                for (int i = 10; i <= b; i++) {
                    dp[i] = dp[i / 10] + dp[i % 10];
                    if (i >= a) {
                        ans += dp[i];
                    }
                }
            }
            Console.Write(ans);
            //Console.ReadKey();
        }
    }
}