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

namespace ProblemSolving.CodeForces
{
    class File_Name_978_problem_B
    {
        public static void Main(string[] args)
        {
            while (true)
            {
                string st = Console.ReadLine();
                string str = Console.ReadLine();
                string s = "xxx";
                int cnt = 0;
                for(int i = 0; i < str.Length-2; i++)
                {
                    if(str.Substring(i, 3).Equals(s))
                    {
                        cnt++;
                    }
                }
                Console.WriteLine(cnt);
            }
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TasksCodeForce._700;
using TasksCodeForce._800;

namespace TasksCodeForce
{
    class Program
    {
        static void Main(string[] args)
        {
            _978B_FileName.Method();
        }
    }
}


    string n = Console.ReadLine();
            string mas = Console.ReadLine();
            List<char> array = mas.ToCharArray().ToList();
            int x = 0;
            for (int i = 0; i < array.Count-2; i++)
            {
                if ((array[i] == array[i+1])&(array[i] == array[i+2])&(array[i]=='x'))
                {
                    x += 1;
                }
            }
            Console.Write(x);


using System;

namespace File_Name
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();
            int count = 0;
            for (int i = 0; i < input.Length-2; i++)
            {
                if (input[i] == 'x' && input[i + 1] == 'x' && input[i + 2] == 'x')
                    count++;
            }
            Console.WriteLine(count);

        }
    }
}


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

class program
{
     static int Main()
    {
        int n = int.Parse(Console.ReadLine());
        string input = Console.ReadLine();
        int result = 0;
        int count = 0;
        for (int i = 0; i < input.Length; i++)
        {
            if(input[i]=='x')
            {
                count++;
            }
            else if(count>2)
            {
                result += (count - 2);
                count = 0;
            }
        }
        if(count>2)
            result += (count - 2);
        Console.WriteLine(result);
        return 0;
    }
}


using System;

namespace FlightTask
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine()), k =0;
            string messeage = Console.ReadLine();
            for (int i = 0; i < messeage.Length; i++)
            {
                if ((messeage[i] == 'x') && (messeage[i + 1] == 'x') && (messeage[i + 2] == 'x'))
                {
                    k++;
                }
            }
            Console.WriteLine(k);
        }
    }
}


using System;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Linq;
using System.Security;
using System.Text;

namespace Codeforces
{
    class Program
    {
        private static string readString() => Console.ReadLine();
        private static T readValue<T>() => (T)Convert.ChangeType(readString(), typeof(T));
        private static string[] readStrings(char delimiter = ' ') => readString().Split(delimiter);
        private static T[] readValues<T>(char delimiter = ' ') => readStrings(delimiter: delimiter).Select(x => (T)Convert.ChangeType(x, typeof(T))).ToArray();
        private static void write<T>(T s) => Console.WriteLine(s);

        private static int binarySearch<T>(List<T> list, T target) where T : IComparable
        {
            int l = 0, r = list.Count - 1;
            while (l <= r)
            {
                var m = (int)Math.Floor((double)(l + r) / 2);
                if (list[m].CompareTo(target) <= 0)
                    if (m == r || list[m + 1].CompareTo(target) > 0)
                        return m;
                    else
                        l = m + 1;
                else
                    r = m - 1;
            }
            return -1;
        }

        private static int quickSortPartition<T>(List<T> arr, int left, int right, Comparer<T> comparer)
        {
            T pivot = arr[left];
            while (true)
            {
                while (comparer.Compare(arr[left], pivot) < 0)
                    left++;
                while (comparer.Compare(arr[right], pivot) > 0)
                    right--;
                if (left < right)
                {
                    if (comparer.Compare(arr[left], arr[right]) == 0)
                        return right;

                    T temp = arr[left];
                    arr[left] = arr[right];
                    arr[right] = temp;
                }
                else
                    return right;
            }
        }
        private static void quickSort<T>(List<T> arr, int left, int right, Comparer<T> comparer)
        {
            if (left < right)
            {
                int pivot = quickSortPartition(arr, left, right, comparer);
                if (pivot > 1)
                    quickSort(arr, left, pivot - 1, comparer);
                if (pivot + 1 < right)
                    quickSort(arr, pivot + 1, right, comparer);
            }
        }

        private static void watermelon()
        {
            var w = readValue<int>();
            write(w >= 4 && w % 2 == 0 ? "YES" : "NO");
        }
        private static void wayTooLongWords()
        {
            var words = new List<string>();

            var n = readValue<int>();
            for (int i = 0; i < n; ++i)
                words.Add(readString());

            foreach (var word in words)
                write(word.Length <= 10 ? word : $"{word.First()}{word.Length - 2}{word.Last()}");
        }
        private static void team()
        {
            int solve = 0;

            var n = readValue<int>();
            for (int i = 0; i < n; ++i)
                if (readValues<int>().Where(x => x == 1).Count() > 1)
                    ++solve;

            write(solve);
        }
        private static void football()
        {
            var positions = readString();
            for (int i = 6; i < positions.Length; ++i)
                if (positions.Substring(i - 6, 6) == (positions[i] == '0' ? "000000" : "111111"))
                {
                    write("YES");
                    return;
                }
            write("NO");
        }
        private static void theatreSquare()
        {
            var sizes = readValues<int>();
            write((long)Math.Ceiling((double)sizes[0] / (double)sizes[2]) * (long)Math.Ceiling((double)sizes[1] / (double)sizes[2]));
        }
        private static void stringTask()
        {
            var Vowels = new HashSet<char> { 'a', 'o', 'y', 'e', 'u', 'i' };
            var sb = new StringBuilder();
            var s = readString().ToLower();
            foreach (var c in s)
                if (!Vowels.Contains(c))
                {
                    sb.Append('.');
                    sb.Append(c);
                }

            write(sb.ToString());
        }
        private static void taxi()
        {
            int taxis = 0;
            var groups = new Dictionary<int, int> { { 1, 0 }, { 2, 0 }, { 3, 0 } };

            readValue<int>();
            var groupSizes = readValues<int>();
            foreach (var size in groupSizes)
                if (size == 4)
                    ++taxis;
                else
                    groups[size] = groups[size] + 1;

            taxis += groups[3];
            groups[1] = groups[1] - Math.Min(groups[1], groups[3]);

            taxis += groups[2] / 2;
            if (groups[2] % 2 == 1)
            {
                ++taxis;
                groups[1] = groups[1] - 2;
            }

            if (groups[1] > 0)
                taxis += (int)Math.Ceiling((double)groups[1] / 4.0);

            write(taxis);
        }
        private static void fancyFence()
        {
            var a = readValue<int>();
            for (double i = 3.0; ; i += 1.0)
            {
                var x = (double)(i - 2.0) * 180.0 / i;
                if (a <= x)
                {
                    write(a < x ? "NO" : "YES");
                    break;
                }
            }
        }
        private static void interestingDrink()
        {
            readString();
            var prices = readValues<int>().OrderBy(x => x).ToList();
            var days = readValue<int>();
            for (int i = 0; i < days; ++i)
                write(binarySearch(prices, readValue<int>()) + 1);
        }
        private static void compilationErrors()
        {
            readString();
            Dictionary<int, int> errors = readValues<int>().GroupBy(x => x).ToDictionary(x => x.Key, x => x.Count()), errors1 = new Dictionary<int, int>();
            foreach (var error in readValues<int>())
            {
                if (errors[error] > 1)
                    errors[error] = errors[error] - 1;
                else
                    errors.Remove(error);

                if (errors1.TryGetValue(error, out var count))
                    errors1[error] = count + 1;
                else
                    errors1.Add(error, 1);
            }
            write(errors.First().Key);

            foreach (var error in readValues<int>())
                if (errors1[error] > 1)
                    errors1[error] = errors1[error] - 1;
                else
                    errors1.Remove(error);
            write(errors1.First().Key);
        }
        private static void doubleCola()
        {
            var idToName = new Dictionary<int, string> { { 0, "Sheldon" }, { 1, "Leonard" }, { 2, "Penny" }, { 3, "Rajesh" }, { 4, "Howard" } };
            int n = readValue<int>(), i = 1;
            for (; n > i * 5; i *= 2)
                n -= i * 5;
            write(idToName[(n - 1) / i]);
        }
        private static void ilyaAndQueries()
        {
            var dic = new Dictionary<int, int>();
            var list = new List<Tuple<int, int>>();

            var s = readString();
            int start = 0, dicStart = 0;
            for (int j = 0; j < s.Length - 1; ++j)
                if (s[j] != s[j + 1])
                {
                    if (start < j)
                    {
                        list.Add(new Tuple<int, int>(start + 1, j + 1));
                        for (; dicStart < j + 1; ++dicStart)
                            dic.Add(dicStart, list.Count - 1);
                    }
                    start = j + 1;
                }
            if (start < s.Length - 1)
            {
                list.Add(new Tuple<int, int>(start + 1, s.Length));
                for (; dicStart < s.Length; ++dicStart)
                    dic.Add(dicStart, list.Count - 1);
            }

            var m = readValue<int>();
            for (int j = 0; j < m; ++j)
            {
                var q = readValues<int>();
                int l = q[0], r = q[1], result = 0;
                if (dic.TryGetValue(l, out var i))
                    for (; i < list.Count && r >= list[i].Item1; ++i)
                        if (l < list[i].Item2)
                            result += Math.Min(r, list[i].Item2) - Math.Max(l, list[i].Item1);
                write(result);
            }
        }
        private static void twoTeamsComposing()
        {
            var n = readValue<int>();
            var skills = readValues<int>().GroupBy(x => x).ToDictionary(x => x.Key, x => x.Count());
        }
        #region Laptop
        private class Laptop
        {
            internal int Price { get; private set; }
            internal int Quality { get; private set; }
            internal Laptop(int[] values)
            {
                Price = values[0];
                Quality = values[1];
            }
        }
        private class Laptop_Comparer_Price : Comparer<Laptop>
        {
            public override int Compare([AllowNull] Laptop x, [AllowNull] Laptop y) => x.Price - y.Price;
        }
        private class Laptop_Comparer_Quality : Comparer<Laptop>
        {
            public override int Compare([AllowNull] Laptop x, [AllowNull] Laptop y) => x.Quality - y.Quality;
        }
        private static void laptops()
        {
            List<Laptop> prices = new List<Laptop>(), qualities = new List<Laptop>();
            var n = readValue<int>();
            for (int i = 0; i < n; ++i)
            {
                var laptop = new Laptop(readValues<int>());
                prices.Add(laptop);
                qualities.Add(laptop);
            }

            for (int i = 0; i < n; ++i)
                if (prices[i] != qualities[i])
                {
                    write("Happy Alex");
                    return;
                }
            write("Poor Alex");
        }
        #endregion
        private static void fence()
        {
            int k = readValues<int>()[1], minI = 0, currentH = 0;
            int[] h = readValues<int>();

            for (int i = 0; i < k; ++i)
                currentH += h[i];
            var minH = currentH;

            for (int i = 1; i < h.Length - k + 1; ++i)
            {
                currentH = currentH - h[i - 1] + h[i + k - 1];
                if (minH > currentH)
                {
                    minH = currentH;
                    minI = i;
                }
            }

            write(minI + 1);
        }
        #region serejaAndSuffixes
        private class SerejaL
        {
            internal int L { get; private set; }
            internal int Result;
            internal SerejaL(int l)
            {
                L = l;
            }
        }
        private class SerejaLComparerL : Comparer<SerejaL>
        {
            public override int Compare([AllowNull] SerejaL x, [AllowNull] SerejaL y) => x.L - y.L;
        }
        private static void serejaGetLs(int m, out List<SerejaL> listDistinct, out List<SerejaL> listOrdered)
        {
            listDistinct = new List<SerejaL>();
            listOrdered = new List<SerejaL>();
            var dic = new Dictionary<int, SerejaL>();
            for (int i = 0; i < m; ++i)
            {
                var l = readValue<int>() - 1;
                if (!dic.TryGetValue(l, out var item))
                {
                    item = new SerejaL(l);
                    dic.Add(l, item);
                    listDistinct.Add(item);
                }
                listOrdered.Add(item);
            }
            quickSort(listDistinct, 0, listDistinct.Count - 1, new SerejaLComparerL());
        }
        private static void serejaAndSuffixes()
        {
            var m = readValues<int>()[1];
            var a = readValues<int>();
            serejaGetLs(m, out var listDistinct, out var listOrdered);

            var distinct = new HashSet<int>();
            for (int i = listDistinct.Count - 1, j = a.Length - 1; i >= 0; --i)
            {
                for (; j >= listDistinct[i].L; --j)
                    if (!distinct.Contains(a[j]))
                        distinct.Add(a[j]);

                listDistinct[i].Result = distinct.Count;
            }

            foreach (var item in listOrdered)
                write(item.Result);
        }
        #endregion
        private static void bowWowTimetable()
        {
            string s = readString(), r = "1";
            int i = 1;
            for (; r.Length < s.Length; ++i, r = r + "00") ;
            if (r.Length > s.Length || !s.Substring(1).Contains('1'))
                write(i - 1);
            else
                write(i);
        }
        private static void digits()
        {
            readString();
            var numbers = readValues<int>().GroupBy(x => x).ToDictionary(x => x.Key, x => x.Count());
            if (!numbers.ContainsKey(0))
            {
                write(-1);
                return;
            }
        }
        private static void lifeWithoutZeros()
        {
            long a = readValue<int>(), b = readValue<int>(), c = a + b;
            write(Convert.ToInt64(a.ToString().Replace("0", "")) + Convert.ToInt64(b.ToString().Replace("0", "")) == Convert.ToInt64(c.ToString().Replace("0", "")) ? "YES" : "NO");
        }
        private static void permutation()
        {
            var n = readValue<int>();
            var a = readValues<int>();
            write(n - a.Where(x => x <= n).Distinct().Count());
        }
        private static void hamsterFarm()
        {
            var n = readValues<long>()[0];
            var k = readValues<long>();
            int bestI = 0;
            for (int i = 1; i < k.Length; ++i)
                if (n % k[i] < n % k[bestI])
                    bestI = i;
            write($"{bestI + 1} {n / k[bestI]}");
        }
        private static void shellGame()
        {
            int n = readValue<int>(), x = readValue<int>();
            for (int i = n; i > 0; --i)
                if (i % 2 == 1)
                {
                    if (x == 0)
                        x = 1;
                    else if (x == 1)
                        x = 0;
                }
                else if (x == 1)
                    x = 2;
                else if (x == 2)
                    x = 1;
            write(x);
        }

        static void Main(string[] args)
        {
            //var t = readValue<int>();
            //for (int i = 0; i < t; ++i)
            shellGame();
        }
    }
}


using System;

namespace ConsoleOut
{
    class Program
    {

        static void Main(string[] args)
        {
            int a = int.Parse(Console.ReadLine());//操作数
            int b = int.Parse(Console.ReadLine());//停留数
            while (true)
            {
                if (a % 2 == 0)
                {
                    if (b == 1)
                    {
                        b = 2;
                    }
                    else if (b == 2)
                    {
                        b = 1;
                    }
                }
                else
                {
                    if (b == 0)
                    {
                        b = 1;
                    }
                    else if (b == 1)
                    {
                        b = 0;
                    }
                }
                if (--a <= 0)
                {
                    break;
                }
            }
            Console.Write(b);
        }
    }
}


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

namespace KingsWay
{
    class Program
    {

        static void Main(string[] args)
        {

         int n = int.Parse(Console.ReadLine());
         int x = int.Parse(Console.ReadLine());
         int initial = 0;

         int[] shells = new int[3];

        for(int i = 0;i<shells.Length;i++)
        {
            if(i==x)
            {
                shells[i]=1;
            }
            else
            {
                shells[i]=0;
            }
        }

         for(int i = n;i>0;i--)
         {
             if(i%2==0)
             {
                 int temp1 = shells[2];
                 shells[2] = shells[1];
                 shells[1] = temp1;
             }
             else
             {
                 int temp2 = shells[0];
                 shells[0] = shells[1];
                 shells[1] = temp2;
             }
         }

         for(int i=0;i<shells.Length;i++)
         {
             if(shells[i]==1)
             {
                 initial = i;
                 break;
             }
         }

		 Console.WriteLine(initial);
         Console.ReadLine();
        }
    }
}


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 = Convert.ToInt32(Console.ReadLine());
            int Y = Convert.ToInt32(Console.ReadLine());
            int[] arr=new int[3];
            arr[Y] = 1;

            for (int i = N; i >= 1; i--)
            {
                if (i%2 == 1)
                {
                    int temp = arr[0];
                    arr[0] = arr[1];
                    arr[1] = temp;
                }
                else
                {
                    int temp = arr[2];
                    arr[2] = arr[1];
                    arr[1] = temp;
                }
            }

            for (int i = 0; i < arr.Length; i++)
            {
                if (arr[i] == 1)
                {
                    Console.WriteLine(i);
                }
            }
        }
    }
}


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

namespace Fight_the_Monster
{
    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 HPY = Next(), ATKY = Next(), DEFY = Next();
            int HPM = Next(), ATKM = Next(), DEFM = Next();
            int h = Next(), a = Next(), d = Next();

            int min = int.MaxValue;

            for (int ia = 0; ia <= 200; ia++)
            {
                for (int id = 0; id <= 100; id++)
                {
                    int cost = ia*a + id*d;

                    if (cost > min)
                        break;

                    int dY = Math.Max(0, ATKM - DEFY - id);
                    int dM = Math.Max(0, ATKY + ia - DEFM);

                    int cm = (HPM + dM - 1)/dM;
                    int ih = Math.Max(0, cm*dY + 1 - HPY);

                    cost += ih*h;

                    if (cost < min)
                        min = cost;
                }
            }
            writer.WriteLine(min);
            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';
            }
        }
    }
}


 int w = 0;
            Console.WriteLine("Enter Wight for Watermelon");
           w=int.Parse( Console.ReadLine());
           if (w >= 1 && w <= 100)
           {
               if (w % 2 == 0)
                   Console.WriteLine("YES");
           }


using System;
class Program
{
	public static void Main() {
		var n = int.Parse(Console.ReadLine());
		Console.WriteLine(n > 5 && n % 2 == 0 ? "YES" : "NO");
	}
}
Program.Main();


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeForces_Ex", "CodeForces_Ex\CodeForces_Ex.csproj", "{BE4F4D0F-E27F-460E-A4C7-50188C25F76E}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU
		Release|Any CPU = Release|Any CPU
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{BE4F4D0F-E27F-460E-A4C7-50188C25F76E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{BE4F4D0F-E27F-460E-A4C7-50188C25F76E}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{BE4F4D0F-E27F-460E-A4C7-50188C25F76E}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{BE4F4D0F-E27F-460E-A4C7-50188C25F76E}.Release|Any CPU.Build.0 = Release|Any CPU
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
EndGlobal


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

namespace Exercises
{
    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                Task4A();
                Console.ReadLine();
            }
        }

        static void Task4A()
        {
            Console.WriteLine("Input weight of watermellow:");
            var word = Console.ReadLine().Trim();
            int weight;
            if (int.TryParse(word, out weight))
            {
                if((weight / 2 % 2) == 0)
                {
                    Console.WriteLine("YES");
                }
                else
                {
                    Console.WriteLine("NO");
                }
            }
            else
            {
                Console.WriteLine("Input error.");
            }
        }

        static void Task131A()
        {
            Console.WriteLine("Введите слово:");
            var word = Console.ReadLine().Trim();
            var wordArray = word.ToArray();

            if (word.Length <= 100 && word.Length > 0 && !word.Contains(" "))
            {
                bool isConvertationNeeded = true;
                for (int i = 1; i < wordArray.Length; i++)
                {
                    if (isConvertationNeeded && wordArray[i].ToString() == wordArray[i].ToString().ToUpper())
                    {
                        isConvertationNeeded = true;
                    }
                    else
                    {
                        isConvertationNeeded = false;
                    }
                }

                if (isConvertationNeeded)
                {
                    var isFirstLetterLow = wordArray[0].ToString() == wordArray[0].ToString().ToLower();

                    word = word.ToLower();

                    if (isFirstLetterLow)
                    {
                        word = word.Remove(0, 1);
                        word = word.Insert(0, wordArray[0].ToString().ToUpper());
                    }
                }

                Console.WriteLine(word);

            }
            else
            {
                Console.WriteLine("Ошибка ввода.");
            }
        }

        static void Task460A()
        {
            Console.WriteLine("Введите n, m:");
            var numbers = Console.ReadLine().Trim();
            var numbersArray = numbers.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
            int n, m;

            if (numbersArray.Length == 2 && int.TryParse(numbersArray[0], out n) && int.TryParse(numbersArray[1], out m)
                && n >= 1 && n <= 100 && m >= 1 && m <= 100)
            {
                int day = 0;
                for (int i = n; i > 0; i--)
                {
                    day++;
                    if (day % m == 0) { i++; }
                }
                Console.WriteLine(day);
            }
            else
            {
                Console.WriteLine("Ошибка ввода.");
            }
        }

        static void Task71A()
        {
            Console.WriteLine("Введите число строк:");
            int numberOfStrings;
            if (int.TryParse(Console.ReadLine().Trim(), out numberOfStrings) && numberOfStrings <= 100 && numberOfStrings >= 1)
            {
                var strings = new string[numberOfStrings];
                for (int i = 0; i < numberOfStrings; i++)
                {
                    Console.WriteLine("Введите {0}ю строку:", i + 1);
                    strings[i] = Console.ReadLine().Trim();
                    if (strings[i].Length > 10)
                    {
                        var length = strings[i].Length;
                        var firstLetter = strings[i].ToArray()[0];
                        var lastLetter = strings[i].ToArray()[length - 1];
                        strings[i] = String.Format("{0}{1}{2}", firstLetter, length, lastLetter);
                    }
                }

                foreach (var word in strings)
                {
                    Console.WriteLine(word);
                }

            }
            else
            {
                Console.WriteLine("Ошибка ввода.");
            }
        }

        static void Task118A()
        {
            var vowels = new [] { "a", "o", "y", "e", "u", "i" };

            Console.WriteLine("Введите слово:");
            var word = Console.ReadLine().Trim().ToLower();

            if (word.Length <= 100)
            {
                foreach(var letter in vowels){
                    word = word.Replace(letter, "");
                }

                var wordArray = word.ToArray();
                word = "";

                for (int i = 0; i < wordArray.Length; i++)
                {
                    word = word + "." + wordArray[i];
                }

                Console.WriteLine(word);
            }
            else
            {
                Console.WriteLine("Ошибка ввода.");
            }
        }

        static void Task281A()
        {
            Console.WriteLine("Введите слово:");
            var word = Console.ReadLine().Trim();

            if (word.Length < 1000)
            {
                var letter = word.ToArray()[0];
                var letterCap = letter.ToString().ToUpper();
                word = word.Remove(0, 1);
                word = word.Insert(0, letterCap);
                Console.WriteLine(word);
            }
            else
            {
                Console.WriteLine("Ошибка ввода.");
            }
        }

        static void Task110A()
        {
            Console.WriteLine("Введите число:");
            var numberString = Console.ReadLine().Trim();
            UInt64 i;
            if (UInt64.TryParse(numberString, out i) && i <= Math.Pow(10, 18))
            {
                var happyDigitsCount = numberString.Count(x => x == '7' || x == '4');
                if (happyDigitsCount.ToString().Any(x => x != '7' && x != '4'))
                {
                    Console.WriteLine("No");
                }
                else
                {
                    Console.WriteLine("Yes");
                }
            }
            else
            {
                Console.WriteLine("Ошибка ввода.");
            }
        }
    }
}


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

namespace CleanCode
{
    class Program
    {
        static void Main(string[] args)
        {
            double n = double.Parse(Console.ReadLine());
            double m = double.Parse(Console.ReadLine());
            double a = double.Parse(Console.ReadLine());
            double res = Math.Round((n / a)) * Math.Round((m / a));
            Console.WriteLine(res.ToString());
        }
    }
}


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26228.4
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "msp watermelon", "msp watermelon\msp watermelon.csproj", "{EFBC6D34-8A95-4ACC-99BB-51D914FEBA5D}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU
		Release|Any CPU = Release|Any CPU
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{EFBC6D34-8A95-4ACC-99BB-51D914FEBA5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{EFBC6D34-8A95-4ACC-99BB-51D914FEBA5D}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{EFBC6D34-8A95-4ACC-99BB-51D914FEBA5D}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{EFBC6D34-8A95-4ACC-99BB-51D914FEBA5D}.Release|Any CPU.Build.0 = Release|Any CPU
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
EndGlobal


void Main()
{
    int n;
    string nstring = Console.ReadLine();
    if (int.TryParse(nstring, out n)){
        if(n<=0 || n==2){
            Console.WriteLine("NO\n");
        }else{
            if(n%2==0){
                Console.WriteLine("YES\n");
            }else{
                Console.WriteLine("NO\n");
            }
        }
    }else{
        Console.WriteLine("numero no valido\n");
    }
}

// Define other methods and classes here


using System;
namespace application1

{
	class Program

		{

			static void Main(string[] args)

			{
				int w = Console.Read();
				if (w==2)
				{
					Console.Write("NO");
				}
				elseif(w<4)
				{
					Console.Write("NO");
				}
				else
				{
					if((w-2)%2==0)
					{
						Console.Write("YES");
					}
					else
					{
						Console.Write("NO");
					}
				}
			}

		}
}


using System;

public class Program
{
	public static void Main()
	{
		var n = int.Parse(Console.ReadLine());
		var min = MinTriangulation(1, n);
		Console.WriteLine(min);
	}

	private static int MinTriangulation(int i, int j){
		if(j-i<2)
			return 0;

		var min = int.MaxValue;
		for(int k=i+1; k<=j-1; k++){
			min = Math.Min(min, MinTriangulation(i,k) + i*k*j + MinTriangulation(k,j));
		}
		return min;
	}
}


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;

namespace probleme {
    class Program {
        static void Main(string[] args) {
            int n = int.Parse(Console.ReadLine());
            string s1 = Console.ReadLine();
            string s2 = Console.ReadLine();
            int ans = 0;
            for (int i = 0; i < n; i++) {
                int a = s1[i] - '0', b = s2[i] - '0';
                if (a == b)
                    continue;
                if (a < b)
                    ans += Math.Min(b - a, a + 9 - b + 1);
                else
                    ans += Math.Min(a - b, b + 9 - a + 1);
            }
            Console.Write(ans);

              // Console.ReadKey();
        }
    }
}


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 = func(7, 3);
            for (int i = 0; i < a.Length; i++)
            {
                Console.WriteLine(a[i].ToString());
            }
        }

        private static int[] func(int a,int b)
        {
            //int[] result = new int[2];
            int f = 0;
            int s = 0;
            if (a == b)
            {
                f = a;
                s = 0;
            }
            else if (a < b)
            {
                f = a;
                b = b - a;
                s = b / 2;
            }
            else if (b < a)
            {
                f = b;
                a = a - b;
                s = a / 2;
            }

            return result;
        }
    }
}


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 = func(-1, 0);
            for (int i = 0; i < a.Length; i++)
            {
                Console.WriteLine(a[i].ToString());
            }
        }

        private static int[] func(int a,int b)
        {
            int[] result = new int[2];
            if (a < 0 || b < 0)
            {
                result[0] = 0;
                result[1] = 0;
            }
            else if (a == b)
            {
                result[0] = a;
                result[1] = 0;
            }
            else if (a < b)
            {
                result[0] = a;
                b = b - a;
                result[1] = b / 2;
            }
            else if (b < a)
            {
                result[0] = b;
                a = a - b;
                result[1] = a / 2;
            }

            return result;
        }
    }
}


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[] r = func(int.Parse(Console.ReadLine()), int.Parse(Console.ReadLine()));
            Console.WriteLine(r[0] + " " + r[1]);

        }

        private static int[] func(int a,int b)
        {
            int[] result = new int[2];
            if (a < 0 || b < 0)
            {
                result[0] = 0;
                result[1] = 0;
            }
            else if (a == b)
            {
                result[0] = a;
                result[1] = 0;
            }
            else if (a < b)
            {
                result[0] = a;
                b = b - a;
                result[1] = b / 2;
            }
            else if (b < a)
            {
                result[0] = b;
                a = a - b;
                result[1] = a / 2;
            }

            return result;
        }
    }
}


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

namespace VasyaAndTheHipster
{
    class Program
    {
        static void Main(string[] args)
        {
            int r, dayX = 0, b, dayY = 0;
            //Console.WriteLine("Enter 2 Numbers : ");

            r = int.Parse(Console.ReadLine());
            b = int.Parse(Console.ReadLine());

            while (b != 0 && r != 0)
            {
                dayX++;
                --r;
                --b;

                if (r == 0 && b != 0)
                {
                    dayY = b / 2;
                    b = 0;

                }
                else if (r != 0 && b == 0)
                {
                    dayY = r / 2;
                    r = 0;

                }
            }

            Console.WriteLine("{0}, {1}",dayX,dayY);

        }
    }
}


using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
using System.Threading;
using System.Diagnostics;
using System.Linq;

#region testlib
public delegate ReadDelegate<T> ReadDelegate<T>(out T value);
public delegate bool ParserDelegate<T>(string word, out T item);

public class Input : IDisposable
{
    private static EventArgs DefaultEventArgs = new EventArgs();

    public TextReader TextReader { get; private set; }

    public event EventHandler OnEndOfStream;
    public event EventHandler OnParseError;
    public event EventHandler OnReadError;

    public bool CanRead { get; private set; }
    public bool ThrowExceptions { get; set; }

    string line = string.Empty;
    int pos = 0;

    static EventHandler emptyHandler;

    public Input(string path)
        : this(File.OpenRead(path))
    {
    }
    public Input(Stream s)
        : this(new StreamReader(s))
    {

    }
    public Input(TextReader tr)
    {
        TextReader = tr;

        if (emptyHandler == null)
            emptyHandler = (a, b) => { };

        OnEndOfStream = emptyHandler;
        OnParseError = emptyHandler;
        OnReadError = emptyHandler;

        CanRead = true;
    }

    public static implicit operator Input(Stream s)
    {
        return new Input(s);
    }
    public static implicit operator Input(TextReader tr)
    {
        return new Input(tr);
    }

    private bool ReadStream()
    {
        if (!CanRead) return false;
        if (pos < line.Length) return true;

        Clear();

        string s = TextReader.ReadLine();
        if (s == null)
        {
            CanRead = false;
            return false;
        }

        line = s;
        return true;
    }

    public ReadDelegate<T> r<T>(out T value)
    {
        value = ReadData<T>();
        return r;
    }

    public void SkipChar()
    {
        if (pos < line.Length) pos++;
        else
        {
            ReadStream();
        }
    }
    public void SkipChars(int length)
    {
        while (length > 0)
        {
            int dt = line.Length - pos;
            if (dt <= 0)
            {
                length--;
                if (!ReadStream()) return;
            }
            dt = Math.Min(length, dt);
            pos += dt;
            length -= dt;
        }
    }

    public void SkipWhiteSpace()
    {
        while (true)
        {
            for (; pos < line.Length; pos++)
            {
                if (!char.IsWhiteSpace(line[pos])) return;
            }
            if (!ReadStream())
            {
                OnEndOfStream(this, DefaultEventArgs);
                return;
            }
        }
    }
    public bool CanReadData()
    {
        SkipWhiteSpace();
        return CanRead;
    }

    public T[] ReadArray<T>()
    {
        int length = ReadInt32();
        return ReadArray<T>(length);
    }
    public T[] ReadArray<T>(int length)
    {
        ParserDelegate<T> parser = Parser.GetPrimitiveParser<T>();
        return ReadArray<T>(length, parser);
    }
    public T[] ReadArray<T>(ParserDelegate<T> parser)
    {
        int length = ReadInt32();
        return ReadArray<T>(length, parser);
    }
    public T[] ReadArray<T>(int length, ParserDelegate<T> parser)
    {
        T[] res = new T[length];
        for (int i = 0; i < length; i++)
        {
            res[i] = ReadData<T>(parser);
        }
        return res;
    }

    public Decimal ReadDecimal()
    {
        return ReadData<Decimal>(Parser.DecimalParser);
    }
    public Double ReadDouble()
    {
        return ReadData<Double>(Parser.DoubleParser);
    }
    public Single ReadSingle()
    {
        return ReadData<Single>(Parser.SingleParser);
    }
    public UInt64 ReadUInt64()
    {
        return ReadData<UInt64>(UInt64.TryParse);
    }
    public UInt32 ReadUInt32()
    {
        return ReadData<UInt32>(UInt32.TryParse);
    }
    public UInt16 ReadUInt16()
    {
        return ReadData<UInt16>(UInt16.TryParse);
    }
    public Int64 ReadInt64()
    {
        return ReadData<Int64>(Int64.TryParse);
    }
    public Int32 ReadInt32()
    {
        return ReadData<Int32>(Int32.TryParse);
    }
    public Int16 ReadInt16()
    {
        return ReadData<Int16>(Int16.TryParse);
    }
    public Boolean ReadYesNo()
    {
        return ReadData<Boolean>(Parser.YesNoParser);
    }
    public Boolean ReadBoolean()
    {
        return ReadData<Boolean>(Boolean.TryParse);
    }
    public Byte ReadByte()
    {
        return ReadData<Byte>(Byte.TryParse);
    }

    private bool ReadCheck()
    {
        if (!CanRead)
        {
            OnReadError(this, DefaultEventArgs);
            if (ThrowExceptions)
            {
                throw new Exception("!CanRead");
            }
            return false;
        }
        return true;
    }
    public T ReadData<T>()
    {
        return ReadData<T>(true);
    }
    public T ReadData<T>(bool skipWhiteSpace)
    {
        ParserDelegate<T> parser = Parser.GetPrimitiveParser<T>();
        return ReadData<T>(parser, skipWhiteSpace);
    }
    public T ReadData<T>(ParserDelegate<T> parser)
    {
        return ReadData<T>(parser, true);
    }
    public T ReadData<T>(ParserDelegate<T> parser, bool skipWhiteSpace)
    {
        if (skipWhiteSpace)
            SkipWhiteSpace();

        if (!ReadCheck()) return default(T);

        string s = ReadWord(false);

        T res;
        if (!parser.Invoke(s, out res))
        {
            OnParseError(this, DefaultEventArgs);
            if (ThrowExceptions)
            {
                throw new Exception("!validate, word = " + Output.ToString(s, 256));
            }
        }
        return res;
    }

    public string ReadWord()
    {
        return ReadWord(true);
    }
    public string ReadWord(bool skipWhiteSpace)
    {
        if (skipWhiteSpace)
            SkipWhiteSpace();

        if (!ReadCheck()) return string.Empty;

        int from = pos;
        int to = pos;
        for (int i = pos; i < line.Length; i++)
        {
            if (char.IsWhiteSpace(line[i])) break;
            to = i + 1;
        }
        pos = to;

        return line.Substring(from, to - from);
    }

    public string ReadLine()
    {
        if (!ReadCheck()) return string.Empty;

        ReadStream();
        string res = line.Substring(pos);
        pos = line.Length;

        return res;
    }

    public void Close()
    {
        TextReader.Close();
    }
    public void Clear()
    {
        pos = 0;
        line = string.Empty;
    }

    private bool disposed = false;
    public void Dispose()
    {
        Dispose(true);
        GC.SuppressFinalize(this);
    }

    protected virtual void Dispose(bool disposing)
    {
        if (!this.disposed)
        {
            if (disposing)
            {
                line = string.Empty;
                TextReader.Dispose();
            }
            disposed = true;
        }
    }
    ~Input()
    {
        Dispose(false);
    }
}
public class Output : IDisposable
{
    static char[] space = new char[] { ' ' };

    public TextWriter TextWriter { get; private set; }
    public bool AutoFlush { get; set; }

    public static string ToString(object obj, int maxLength)
    {
        return ToString(FormatReal(obj), maxLength);
    }
    public static string ToString(string s, int maxLength)
    {
        if (s.Length <= maxLength) return s;
        else return s.Substring(0, maxLength) + "...";
    }
    public static object FormatReal(object v, string format)
    {
        if (v is decimal) return ((decimal)v).ToString(format).Replace(',', '.');
        if (v is double) return ((double)v).ToString(format).Replace(',', '.');
        if (v is float) return ((float)v).ToString(format).Replace(',', '.');

        return v;
    }
    public static object FormatReal(object v)
    {
        if (v is decimal || v is double || v is float)
        {
            return v.ToString().Replace(',', '.');
        }
        return v;
    }

    public Output()
        : this(new MemoryStream())
    {
    }
    public Output(string path)
        : this(File.Create(path))
    {

    }
    public Output(Stream s)
        : this(new StreamWriter(s))
    {
    }
    public Output(TextWriter tw)
    {
        TextWriter = tw;
    }

    public static implicit operator Output(Stream s)
    {
        return new Output(s);
    }

    public static implicit operator Output(TextWriter tw)
    {
        return new Output(tw);
    }

    public static Output operator +(Output output, object obj)
    {
        output.Write(obj);
        return output;
    }
    public Output WriteArray<T>(params T[] array)
    {
        return WriteArray<T>(array, false);
    }
    public Output WriteArray<T>(T[] array, bool appendLength)
    {
        return WriteArray<T>(array, 0, array.Length, appendLength);
    }
    public Output WriteArray<T>(T[] array, int index, int count)
    {
        return WriteArray<T>(array, index, count, false);
    }
    public Output WriteArray<T>(T[] array, int index, int count, bool appendLength)
    {
        if (index + count > array.Length)
        {
            string message = string.Format(
                "Index out of range: {0} + {1} >= {2}",
                index,
                count,
                array.Length);
            throw new Exception(message);
        }
        if (appendLength)
        {
            WriteLine(count);
        }
        for (int i = 0; i < count; i++)
        {
            Write(array[i]);
            Write(space, 0, space.Length);
        }
        WriteLine();

        return this;
    }
    public Output WriteLine(object obj)
    {
        obj = FormatReal(obj);
        return WriteLine(obj.ToString());
    }
    public Output WriteLine(string format, params object[] args)
    {
        return WriteLine(string.Format(format, args));
    }
    public Output WriteLine(string s)
    {
        return WriteLine(s.ToCharArray());
    }
    public Output WriteLine(char[] buffer)
    {
        return WriteLine(buffer, 0, buffer.Length);
    }
    public Output WriteLine(char[] buffer, int index, int count)
    {
        TextWriter.WriteLine(buffer, index, count);
        if (AutoFlush) TextWriter.Flush();
        return this;
    }
    public Output WriteLine()
    {
        TextWriter.WriteLine();
        if (AutoFlush) TextWriter.Flush();
        return this;
    }
    public Output Write(object obj)
    {
        obj = FormatReal(obj);
        return Write(obj.ToString());
    }
    public Output Write(string format, params object[] args)
    {
        return Write(string.Format(format, args));
    }
    public Output Write(string s)
    {
        return Write(s.ToCharArray());
    }
    public Output Write(char[] buffer)
    {
        return Write(buffer, 0, buffer.Length);
    }
    public Output Write(char[] buffer, int index, int count)
    {
        TextWriter.Write(buffer, index, count);
        if (AutoFlush) TextWriter.Flush();
        return this;
    }

    public void Close()
    {
        TextWriter.Close();
    }
    public void Flush()
    {
        TextWriter.Flush();
    }

    private bool disposed = false;
    public void Dispose()
    {
        Dispose(true);
        GC.SuppressFinalize(this);
    }

    protected virtual void Dispose(bool disposing)
    {
        if (!this.disposed)
        {
            if (disposing)
            {
                TextWriter.Dispose();
            }
            disposed = true;
        }
    }
    ~Output()
    {
        Dispose(false);
    }
}
public static class Parser
{
    public static ParserDelegate<T> GetPrimitiveParser<T>()
    {
        if (!typeof(T).IsPrimitive) throw new Exception("Unknown type");
        else if (default(T) is Byte) return new ParserDelegate<Byte>(Byte.TryParse) as ParserDelegate<T>;
        else if (default(T) is Boolean) return new ParserDelegate<Boolean>(Boolean.TryParse) as ParserDelegate<T>;
        else if (default(T) is Int16) return new ParserDelegate<Int16>(Int16.TryParse) as ParserDelegate<T>;
        else if (default(T) is Int32) return new ParserDelegate<Int32>(Int32.TryParse) as ParserDelegate<T>;
        else if (default(T) is Int64) return new ParserDelegate<Int64>(Int64.TryParse) as ParserDelegate<T>;
        else if (default(T) is UInt16) return new ParserDelegate<UInt16>(UInt16.TryParse) as ParserDelegate<T>;
        else if (default(T) is UInt32) return new ParserDelegate<UInt32>(UInt32.TryParse) as ParserDelegate<T>;
        else if (default(T) is UInt64) return new ParserDelegate<UInt64>(UInt64.TryParse) as ParserDelegate<T>;
        else if (default(T) is Single) return new ParserDelegate<Single>(Parser.SingleParser) as ParserDelegate<T>;
        else if (default(T) is Double) return new ParserDelegate<Double>(Parser.DoubleParser) as ParserDelegate<T>;
        else if (default(T) is Decimal) return new ParserDelegate<Decimal>(Parser.DecimalParser) as ParserDelegate<T>;
        else if (default(T) is String) return new ParserDelegate<String>(Parser.StringParser) as ParserDelegate<T>;
        else throw new Exception("Unknown type");
    }
    public static bool YesNoParser(string s, out Boolean result)
    {
        s = s.ToLower();
        if (s == "yes") result = true;
        else if (s == "no") result = false;
        else
        {
            result = false;
            return false;
        }
        return true;
    }
    public static bool StringParser(string s, out string result)
    {
        result = s;
        return string.IsNullOrEmpty(s);
    }
    public static bool DecimalParser(string s, out Decimal result)
    {
        return Decimal.TryParse(s.Replace('.', ','), out result);
    }
    public static bool DoubleParser(string s, out Double result)
    {
        return Double.TryParse(s.Replace('.', ','), out result);
    }
    public static bool SingleParser(string s, out Single result)
    {
        return Single.TryParse(s.Replace('.', ','), out result);
    }
}
#endregion
static class Program
{
    #region Streams
    static string endl = Environment.NewLine;
    static Input cin = new Input(Console.In);
    static Output cout = new Output(Console.Out);
    static Output cerr = new Output(Console.Error);

    static void InitIO()
    {
#if !DEBUG
        cin = new Input("input.txt");
        cout = new Output("output.txt");
#endif
    }
    #endregion
    #region Time
    static Stopwatch sw = new Stopwatch();
    static void Start()
    {
        sw.Reset();
        sw.Start();
    }
    static void Restart(string text = "")
    {
        Stop(text);
        Start();
    }
    static void Time(string text = "")
    {
        if (string.IsNullOrEmpty(text))
        {
            cerr.WriteLine(sw.Elapsed);
        }
        else
        {
            cerr.WriteLine(text + ": " + sw.Elapsed);
        }
    }
    static void Stop(string text = "")
    {
        sw.Stop();
        Time(text);
    }
    //*/
    #endregion
    const string nyan = "^_^";
    static void Solve()
    {
        var a = cin.ReadInt32();
        var b = cin.ReadInt32();

        cout.WriteLine("{0} {1}", Math.Min(a, b), (Math.Max(a, b) - Math.Min(a, b) / 2);
    }

    static string[] Tests =
    {
        @"3 1 2
1 1 1",
        @"4 2 3
1 2 4 8",
        @"3 1 2
17 18 4"
    };

    static string Generate(int n, int t, int seed)
    {
        var rnd = new Random(seed);
        var a = new int[n];
        for (var i = 0; i < n; i++)
        {
            a[i] = rnd.Next(1, 101);
        }

        var sb = new StringWriter();
        var output = new Output(sb);

        output.WriteLine("{0} {1}", n, t);
        output.WriteArray(a, false);

        return sb.ToString();
    }
    static void Main()
    {
#if DEBUG
        if (Tests.Length == 0)
        {
            Solve();
        }
        else
        {
            foreach(var test in Tests)
            {
                cin = new Input(new StringReader(test));
                Solve();
            }
            /*
            for (var i = 0; i < 100; i++)
            {
                var test = Generate(100, 10000000, i);
                Start();
                cin = new Input(new StringReader(test));
                Solve();
                Stop();
            }
            //*/
        }

#else
        Solve();
#endif
    }
}


using System;

public class Program
{
    public static void Main()
    {
        var input = Console.ReadLine().Split(' ');
        var a = int.Parse(input[0]);
        var ta = int.Parse(input[1]);
        input = Console.ReadLine().Split(' ');
        var b = int.Parse(input[0]);
        var tb = int.Parse(input[1]);
        input = Console.ReadLine().Split(':');

        // All time points are in minutes.
        var tripBegin = int.Parse(input[0])*60 + int.Parse(input[1]);
        var trafficBegin = 5*60;
        var trafficEnd = 23*60 + 59;
        var approachingTrafficBegin = Math.Max(tripBegin - tb + 1, trafficBegin);
        var approachingTrafficEnd = Math.Min(tripBegin + ta - 1, trafficEnd);
        var firstApproachingBus =
            approachingTrafficBegin % b == 0 ?
                approachingTrafficBegin :
                approachingTrafficBegin + (b - approachingTrafficBegin % b);
        var approachingBusesCount = 0;
        if (approachingTrafficEnd >= firstApproachingBus)
            approachingBusesCount = (approachingTrafficEnd - firstApproachingBus) / b + 1;
        Console.WriteLine(approachingBusesCount);
    }
}


using System;

class Solution
{
	void Main()
	{
		var inputs = Console.ReadLine().Split();
		var a = int.Parse(inputs[0]);
		var ta = int.Parse(inputs[1]);
		inputs = Console.ReadLine().Split();
		var b = int.Parse(inputs[0]);
		var tb = int.Parse(inputs[1]);
		inputs = Console.ReadLine().Split(':');
		var hh = int.Parse(inputs[0]);
		var mm = int.Parse(inputs[1]);

		var ts = hh*60 + mm;
		Console.WriteLine(GetNumberOfDepartedBuses(ts-tb, ts+ta, b));
	}

	//Returns number of departed buses in the given interval, if inteval ends are exclusive, and
	static int GetNumberOfDepartedBuses(int intervalStart, int intervalEnd, int departureFrequency, int firstDeparture = 5*60, int lastDeparture = 23*60+59)
	{
		int numUntilStart = intervalStart >= firstDeparture
			? (intervalStart - firstDeparture) / departureFrequency + 1	//Inclusive-Inclusive
			: 0;
		int numUntilEnd = intervalEnd <= lastDeparture
			? ((intervalEnd - 1) - firstDeparture) / departureFrequency + 1	//Inclusive-Exclusive
			: (lastDeparture - firstDeparture) / departureFrequency + 1;	//Inclusive-Inclusive

		return numUntilEnd - numUntilStart;
	}
}


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

namespace Buses_Between_Cities
{
    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 a = Next();
            int ta = Next();

            int b = Next();
            int tb = Next();

            int hh = Next();
            int mm = Next();

            var start = new DateTime(10, 10, 10, hh, mm, 0);
            DateTime end = start.AddMinutes(ta);

            int count = 0;
            for (var i = new DateTime(10, 10, 10, 5, 0, 0); i < end; i = i.AddMinutes(b))
            {
                DateTime e = i.AddMinutes(tb);

                if (e > start)
                    count++;
            }

            writer.WriteLine(count);
            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.Globalization;
using System.IO;
using System.Linq;
using System.Threading;

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

	internal class Task
	{
		public void Solve(int testNumber, InputReader sr, TextWriter sw)
		{
			var input = sr.ReadArray(Int32.Parse);
			var a = input[0];
			var ta = input[1];
			input = sr.ReadArray(Int32.Parse);
			var b = input[0];
			var tb = input[1];
			var str = sr.NextString().Split(new[] { ':' }, StringSplitOptions.RemoveEmptyEntries);
			var h = str[0][0] == '0' ? Int32.Parse(str[0][1].ToString(CultureInfo.InvariantCulture)) : Int32.Parse(str[0]);
			var m = str[1][0] == '0' ? Int32.Parse(str[1][1].ToString(CultureInfo.InvariantCulture)) : Int32.Parse(str[1]);
			var count = 0;
			var start = h * 60 + m;
			int end =start + ta;
			var times = new List<int>();
			var bArr = new List<Tuple<int, int>>();
			for (var startB = 5 * 60; startB + tb <= 23*60 + 59; startB += b) {
				bArr.Add(new Tuple<int, int>(startB, startB + tb));
			}
			for (var i = 0; i < bArr.Count; i++) {
				var next = bArr[i];
				if (start < next.Item2 && next.Item1 < end) {
					count++;
				}
			}

			sw.WriteLine(count);
		}
	}

	internal class InputReader : IDisposable
	{
		private bool isDispose;
		private readonly TextReader sr;

		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(NextString());
		}

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

		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;

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

            string[] t_A = Console.ReadLine().Split(' ');
            string[] t_B = Console.ReadLine().Split(' ');
            string[] HHH = Console.ReadLine().Split(':');
           int hour = 0;
           if (HHH[0][0] == '0') hour = int.Parse(HHH[0][1].ToString());
           else
               hour = int.Parse(HHH[0][0].ToString()) * 10 + int.Parse(HHH[0][1].ToString());
           int minute = 0;
           if (HHH[1][0] == '0') minute = int.Parse(HHH[1][1].ToString());
           else
               minute = int.Parse(HHH[1][0].ToString()) * 10 + int.Parse(HHH[1][1].ToString());
           int starttime = hour * 60 + minute;
           int endtime = starttime + int.Parse(t_A[1].ToString());
           int ans = 0;
           int start = 300;
           int chastota = int.Parse(t_B[0].ToString());
           int time = int.Parse(t_B[1].ToString());
           while (true)
           {
               if (start>=endtime) break;
               if(start+time>starttime)ans++;
               start += chastota;
           }

           Console.WriteLine(ans);

        }
    }
}


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

namespace Undoubtedly_Lucky_Numbers
{
    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)
        {
            string s = reader.ReadLine();
            int n = int.Parse(s);

            int count;
            if (n <= 100)
                count = n;
            else
            {
                count = 99;
                int d = 4;
                for (int le = 3; le < s.Length; le++)
                {
                    count += 9;
                    count += 9*(d-1);
                    count += 36*(2*d - 2);
                }

                int sl = s.Length;
                for (int i = 1; i < 10; i++)
                {
                    int k = i;
                    for (int j = 1; j < sl; j++)
                    {
                        k = k*10 + i;
                    }
                    if (k <= n)
                        count++;
                    for (int j = 0; j < 10; j++)
                    {
                        if (j == i)
                            continue;

                        for (int m = (1 << (sl-1)) - 2; m >= 0; m--)
                        {
                            int mask = m;
                            k = i;
                            for (int jj = 1; jj < sl; jj++)
                            {
                                k *= 10;
                                if ((mask & 1) == 1)
                                    k += i;
                                else k += j;
                                mask >>= 1;
                            }
                            if (k <= n)
                                count++;
                        }
                    }
                }
            }

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


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

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

            List<int> list = new List<int>();
            int sum = 0;
            for (int i = 0; i < 10; i++)
            {
                for (int j = 0; j < 10; j++)
                {
                    for (int k = 1; k < 1024; k++)
                    {
                        int t = 0;
                        for (int l = k, m = 1; l > 0; l >>= 1, m*=10)
                        {

                            if ((l & 0x1) == 1)
                            {
                                t += m * i;
                            }
                            else
                            {
                                t += m * j;
                            }
                        }
                        if (t > 0 && t <= n)
                        {
                            list.Add(t);
                        }
                    }
                }
            }

            list.Sort();
            for (int i = 0; i < list.Count - 1; i++)
            {
                if (list[i] != list[i+1])
                {
                    sum++;
                }
            }
            Console.WriteLine(sum+1);
        }
    }
}


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

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

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

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

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

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

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


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

namespace cf
{
    class Program
    {
        private int n;
        private int k;
        private int[] nums;
        private int startIndex;
        private int total;

        void searchLuckNumber(uint now)
        {
            if (now <= n)
            {
                if (isLuckNumber(getNum(now))) total++;

                searchLuckNumber(now * 10 + 4);
                searchLuckNumber(now * 10 + 7);
            }
        }

        uint getNum(uint index)
        {
            if (index < startIndex)
            {
                return index;
            }
            return (uint)nums[index - startIndex];
        }

        static Boolean isLuckNumber(uint num)
        {
            string str = string.Format("{0}", num);
            for (int i = 0; i < str.Length; i++)
            {
                if (str[i] != '4' && str[i] != '7')
                {
                    return false;
                }
            }
            return true;
        }

        void solve()
        {
            int[] f = new int[16];
            f[0] = 1;
            for (int i = 1; i <= 15; i++)
            {
                f[i] = f[i - 1] * i;
            }

            string nk = Console.ReadLine();
            string[] nks = nk.Split(' ');
            n = int.Parse(nks[0]);
            k = int.Parse(nks[1]);
            int orin = n;
            int orik = k;

            n = Math.Min(n, 15);
            startIndex = orin - n + 1;
            nums = new int[n];
            bool[] used = new bool[n + 1];
            int based = orin - n;
            for (int i = 0; i < n; i++)
            {
                for (int j = 1; j <= n; j++)
                {
                    if (used[j]) continue;
                    if (k > f[n - 1 - i])
                    {
                        k -= f[n - 1 - i];
                    }
                    else
                    {
                        used[j] = true;
                        nums[i] = based + j;
                        break;
                    }
                }
            }

            k = orik;
            n = orin;

            searchLuckNumber(4);
            searchLuckNumber(7);

            Console.WriteLine(total);
        }

        static void Main(string[] args)
        {
            Program m = new Program();
            m.solve();
        }
    }
}


using System;
using System.Collections.Generic;

class MainClass{
        int fact(int x)
        {
            return x == 0 ? 1 : fact(x - 1) * x;
        }

        int pow(int x, int y)
        {
            return y == 0 ? 1 : pow(x, y - 1) * x;
        }
        void gen47s(List<int> arr, int piv, int bias, int n)
        {
            if (piv == 0)
            {
                if (bias + 4 <= n)
                    arr.Add(bias + 4);
                if (bias + 7 <= n)
                    arr.Add(bias + 7);
            }
            else
            {
                gen47s(arr, piv - 1, bias + 4 * pow(10, piv), n);
                gen47s(arr, piv - 1, bias + 7 * pow(10, piv), n);
            }
        }

        int main(int n, int k)
        {
            int ans = 0;
            --k;
            if (n <= 12 && k >= fact(n))
            {
                ans = -1;
                return ans;
            }
            int cons = 12;
            for (cons = 12; cons >= 0; --cons)
                if (k >= fact(cons))
                    break;
            List<int> rest = new List<int>();
            for (int i = n - cons; i <= n; ++i)
                rest.Add(i);
            List<int> arr47 = new List<int>();
            for (int i = 0; i < ("" + n).Length; ++i)
                gen47s(arr47, i, 0, n);
            for (int i = arr47.Count - 1; i >= 0; --i)
                if (arr47[i] < n - cons)
                {
                    ans = i + 1;
                    break;
                }
            foreach (int i in rest.ToArray())
            {
                int q = k / fact(n - i);
                int current = rest[q];
                rest.Remove(current);
                if (arr47.Contains(i) && arr47.Contains(current))
                    ans++;
                k -= q * fact(n - i);
            }
            return ans;
        }
        static void Main(){
            int n, k;
            string[] items = Console.ReadLine().Split(' ');
            n = int.Parse(items[0]);
            k = int.Parse(items[1]);

            Console.Write(main(n, k));
        }
}


using System;
using System.Collections.Generic;

class MainClass{
        int fact(int x)
        {
            return x == 0 ? 1 : fact(x - 1) * x;
        }

        int pow(int x, int y)
        {
            return y == 0 ? 1 : pow(x, y - 1) * x;
        }
        void gen47s(List<int> arr, int piv, int bias, int n)
        {
            if (piv == 0)
            {
                if (bias + 4 <= n)
                    arr.Add(bias + 4);
                if (bias + 7 <= n)
                    arr.Add(bias + 7);
            }
            else
            {
                gen47s(arr, piv - 1, bias + 4 * pow(10, piv), n);
                gen47s(arr, piv - 1, bias + 7 * pow(10, piv), n);
            }
        }

        int main(int n, int k)
        {
            int ans = 0;
            --k;
            if (n <= 12 && k >= fact(n))
            {
                ans = -1;
                return ans;
            }
            int cons = 12;
            for (cons = 12; cons > 0; --cons)
                if (k >= fact(cons))
                    break;
            List<int> rest = new List<int>();
            for (int i = n - cons; i <= n; ++i)
                rest.Add(i);
            List<int> arr47 = new List<int>();
            for (int i = 0; i < ("" + n).Length; ++i)
                gen47s(arr47, i, 0, n);
            for (int i = arr47.Count - 1; i >= 0; --i)
                if (arr47[i] < n - cons)
                {
                    ans = i + 1;
                    break;
                }
            foreach (int i in rest.ToArray())
            {
                int q = k / fact(n - i);
                int current = rest[q];
                rest.Remove(current);
                if (arr47.Contains(i) && arr47.Contains(current))
                    ans++;
                k -= q * fact(n - i);
            }
            return ans;
        }
        static void Main(){
            int n, k;
            string[] items = Console.ReadLine().Split(' ');
            n = int.Parse(items[0]);
            k = int.Parse(items[1]);
            MainClass mn = new MainClass();
            Console.Write(mn.main(n, k));
        }
}


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

namespace CodeForces1
{
    class Program
    {
        static void Main(string[] args)
        {
            char[] symbols = ['h', 'e', 'l', 'l', 'o'];
            string inputString = Console.ReadLine();

            int count = 0;

            foreach(char c in inputString)
            {
                if(count<5
                    && c == symbols[count])
                {
                    count++;
                }
            }

            Console.WriteLine(count == 5 ? "YES" : "NO");
        }
    }
}


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

namespace _58A
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            int count = 0; string str = "hello";
            for (int i = 0; i < s.Length; i++)
            {
                if (s[i] == str[count]) count++;
            }
            if(count == str.Length) Console.WriteLine("YES");
            else Console.WriteLine("NO");
            Console.Read();
        }
    }
}


using System;
using System.Runtime.InteropServices;
using System.Threading;

namespace ConsoleApp3
{
    class Program
    {
        static void Main(string[] args)
        {
            int i=0;
            bool flag = false,flag1=false,flag2=false,flag3=false,flag4=false;
            //int n = Convert.ToInt32(Console.ReadLine());
            String s = Console.ReadLine();
            while (i < s.Length)
            {
                if (s[i] == 'h')
                {
                    flag = true;
                    i++;
                }

                if (flag && s[i] == 'e')
                {
                    flag1 = true;
                    i++;
                }

                if (flag1 && s[i] == 'l' && !flag2)
                {
                    flag2 = true;
                    i++;
                }

                if (flag2 && s[i] == 'l')
                {
                    flag3 = true;
                    i++;
                }

                if (flag3 && s[i] == 'o')
                {
                    flag4 = true;
                    i++;
                }
                else i++;

                if (flag4) break;

            }
            if (flag4) Console.WriteLine("YES");
            else Console.WriteLine("NO");

            Console.ReadLine();
        }
    }
}


using System;
namespace CsharpConsoleApplication
{
    class Program
    {
        static void Main(string[] args)
        {
            String a = Console.ReadLine();
            int h = a.IndexOf('h');
            if (h == -1)
            {
                Console.WriteLine("NO");
                return;
            }
            int e = a.IndexOf('e', h);
            int l = a.IndexOf('l', e);
            int l2 = a.IndexOf('l', l + 1);
            int o = a.IndexOf('o', l2);

            if (h < e && e < l && l < l2 && l2 < o)
                Console.WriteLine("YES");
            else Console.WriteLine("NO");
        }
    }
}


using System;

namespace CF_Hello {
    class Program {
        static void Main(string[] args) {
            string input = Console.ReadLine();
            string example = "hello";
            string output = string.Empty;
            int i = 0;
            while ((example != string.Empty) || (i != input.Length)) {
                if (input[i] == example[0]) {
                    output += input[i];
                    example = example.Remove(0, 1);
                }
                ++i;
            }
            if (output == "hello") {
                Console.WriteLine("YES");
                return;
            }
            Console.WriteLine("NO");
        }
    }
}


using System;

namespace CF_Hello {
    class Program {
        static void Main(string[] args) {
            char[] input = Console.ReadLine().ToCharArray();
            string example = "hello";
            string output = string.Empty;
            int i = 0;
            int deleted = 0;
            while ((i < input.Length)) {
                if (input[i] == example[deleted]) {
                    output += input[i];
                    if (deleted == 5) {
                        Console.WriteLine("YES");
                        return;
                    }
                    ++deleted;
                }
                ++i;
            }
            Console.WriteLine("NO");
        }
    }
}


using System;

namespace CF_Hello {
    class Program {
        static void Main(string[] args) {
            char[] input = Console.ReadLine().ToCharArray();
            string example = "hello";
            string output = string.Empty;
            int deleted = 0;
            for(int i=0;i<input.Length;++i) {
                if (input[i] == example[deleted]) {
                    output += input[i];
                    ++deleted;
                }
            }
            if(deleted == 5) {
                Console.WriteLine("YES");
                return;
            }
            Console.WriteLine("NO");
        }
    }
}


using System;

namespace CF_Hello {
    class Program {
        static void Main(string[] args) {
            string input = Console.ReadLine());
            string example = "hello";
            string output = string.Empty;
            int deleted = 0;
            for(int i=0;i<input.Length;i++) {
                if (input[i] == example[deleted]) {
                    output += input[i];
                    ++deleted;
                }
                if (deleted == 5) {
                    Console.WriteLine("YES");
                    return;
                }
            }
            Console.WriteLine("NO");
        }
    }
}


using System;

namespace CF_Hello {
    class Program {
        static void Main(string[] args) {
            string input = Console.ReadLine();
            string example = "hello";
            int deleted = 0;
            for(int i=0;i<input.Length;i++) {
                if (input[i] == example[deleted]) {
                    ++deleted;
                }
            }
            if (deleted == 5) {
                Console.WriteLine("YES");
                return;
            }
            Console.WriteLine("NO");
        }
    }
}


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

namespace ConsoleApp37
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] inp0 = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int n = inp0[0];
            int m = inp0[1];
            int f1 = 1;
            int f2 = 1;
            for (int i = 1; i <= n; i++)
            {
                f1 *= i;
            }
            for (int i = 1; i <= m; i++)
            {
                f2 *= i;
            }
            Console.WriteLine(GCD(f1,f2));
        }
        private static int GCD(int x, int y)
        {
            int v = 0;
            int n = 0;

            v = GetGreatestDivisor(x, y);

            return v;

        }
        static int GetGreatestDivisor(int m, int h)
        {

            do
            {
                for (int i = m; i >= 1; i--)

                    if (m % i == 0 && h % i == 0)
                    {
                        int x = 0;
                        x = i;

                        return x;
                    }
            } while (true);
            return m;
        }

    }
}


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

namespace B
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] temp = Console.ReadLine().Split(' ');
            string a = temp[0];
            char[] s = a.ToCharArray();
            int k = int.Parse(temp[1]), i, j, savej;
            char tempchar;
            i = 0;
            while (k > 0)
            {
                savej = i + 1;
                for (j = i + 1; j <= i + k; j++)
                {
                    if (j == a.Length)
                        break;
                    if (s[savej] < s[j])
                        savej = j;
                }
                if (s[savej] > s[i])
                {
                    tempchar = s[savej];
                    for (j = savej; j > i; j--)
                        s[j] = s[j - 1];
                    s[i] = tempchar;
                    k -= savej - i;
                    i++;
                }
                else
                {
                    i++;
                    if (i == a.Length)
                        break;
                }
            }
            Console.Write(s);
        }
    }
}


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

namespace Rextester
{
    public class Program
    {
        public static void Main(string[] args)
        {
            byte h, e, l, o, = 0;
            char[] str = Console.ReadLine().ToCharArray();
            if (str.Length < 5)
            {
                Console.WriteLine("NO");
                return;
            }
            for (int i = 0; i < str.Length; i++)
            {
                if (h != 1)
                    h = 1;
                if (h == 1 && e != 1)
                    e = 1;
                if (h == 1 && e == 1 && l!=2)
                    l++;
                if (h == 1; e == 1; l == 2; o != 1)
                    o = 1;
            }
            if (h + e + l + O == 5)
                Console.WriteLine("YES");
            else
                Console.WriteLine("NO");
        }
    }
}


using System;

namespace Sharp
{
    class Program
    {
        static void Main(string[] args)
        {
            string A = Console.ReadLine();
            char[] Alf = { 'h', 'e', 'l', 'l', 'o' };
            string B = "";
            int k = 0;

            foreach (char el in A)
            {
                if (el == Alf[k])
                {
                    B += el;
                    k++;
                }
            }

            if (B.Equals("hello") == true) Console.WriteLine("YES");
            else Console.WriteLine("NO");

            Console.ReadLine();
        }
    }
}


using System;

class Program {
  static void Main() {
    var str = Console.ReadLine();
    var str2 = "hello";
    var i = 0;
    foreach (var c in str) if (c == str2[i])
      if (++i == str2.Length) { Console.WriteLine("YES"); return }
    Console.WriteLine("NO");
  }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CustomExtensions;
namespace CF85_D2_A_ChatRoom
{
    class Program
    {
        static void Main(string[] args)
        {
            string line = Console.ReadLine().ToLower().Trim();
            line = new string(line.ToCharArray().Distinct().ToArray());

            if (line.Contains("helo"))
                Console.WriteLine("YES");
            else
                Console.WriteLine("NO");

        }
    }
}


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

namespace chatRoom
{
    class Program
    {
        static void Main(string[] args)
        {
            int h =0;
            int e = 0;
            int l =0;
            int o =0;
            string word = Console.ReadLine();
            string word1 = "";
            for(int i =0;i<word.Length;i++)
            {
                if (word[i] != 'h' && word[i] != 'e' && word[i] != 'l' && word[i] != 'o') word = word.Remove(i, 1);
                if (h == 0)
                {
                    if (word[i] == 'h')
                    {
                        word1 = word1 + word[i];
                        h++;
                    }
                }
                if (e == 0)
                {
                    if (word[i] == 'e' && word1.Contains('h'))
                    {
                        word1 = word1 + word[i];
                        e++;
                    }
                }
                if (l < 2)
                {
                    if (word[i] == 'l' && word1.Contains("he"))
                    {
                        word1 = word1 + word[i];
                        l++;
                    }
                }
                if (o == 0)
                {
                    if (word[i] == 'o' && word1.Contains("hell"))
                    {
                        word1 = word1 + word[i];
                        o++;
                    }
                }
            }
            if (word1 == "hello") Console.WriteLine("YES");
            else Console.WriteLine("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)
        {
            string[] s = Console.ReadLine().Split(' ');
            int ml = int.Parse(s[0]);
            int mr = int.Parse(s[1]);
            bool can = false ;
            s = Console.ReadLine().Split(' ');
            int fl = int.Parse(s[0]);
            int fr = int.Parse(s[1]);
            if (fr * 3 >= ml && fr <= ml + 1)
            {
                can = true;
            } if (fl * 3 >= mr && fl <= mr + 1)
            {
                can = true;
            }
            if (can)
            {
                Console.WriteLine("YES");
            }
            else
            {
                Console.WriteLine("NO");
            }
        }

    }
}


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

namespace LearningCSharp
{
    class _58A
    {

        static void Main(string [] args) {

            string input = "hello";char[] kb = input.ToArray(); int temp = 0;
            string t1 = Console.ReadLine();
            foreach (var ch in t1)
            {
                if (kb[temp] == ch) { temp++; }
            }
            if (temp == 5) { Console.WriteLine("YES"); }
            else { Console.WriteLine("NO"); }

        }

    }
}


using System;
using System.Linq;

namespace Tiling.With.Hexagons
{
    class Program
    {
        static void Main(string[] args)
        {
            var input = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();

            Console.WriteLine((input[0]*input[1]) + (input[1]*(input[2]-1)) + (input[2]-1));
        }
    }
}


using System;
using System.Diagnostics;

namespace TestProject
{
    class Program
    {
        public static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var sqrtN = (int)Math.Ceiling(Math.Sqrt(n));
            var sw = Stopwatch.StartNew();
            for (var h = sqrtN; h >= 1; h--)
            {
                for (var w = sqrtN; w <= n; w++)
                {
                    if (h*w == n)
                    {
                        Console.WriteLine($"{h} {w}");
                        Console.WriteLine(sw.Elapsed);
                        Environment.Exit(0);
                    }
                }
            }
        }
    }
}


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

namespace ConsoleApplication6
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            int min = 999999999;
            int a = 0;
            int b = 0;
            for (int i = 1; i < n; i++)
            {
                if (n % i == 0)
                {
                    int raz = Math.Abs(i - (n / i));
                    if (raz < min)
                    {
                        min = raz;
                        a = i;
                        b = n / i;
                    }
                }
            }
            Console.WriteLine(Math.Min(a,b) + " " + Math.Max(a,b));
        }
    }
}


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

namespace Test
{
    class Program
    {
        static void Main()
        {
            int n = Int32.Parse(Console.ReadLine());
            string s = Console.ReadLine();
            int ans = 0;
            for (int begin = 0; begin < n; begin++)
                for (int end = begin; end < n; end++)
                {
                    int x = 0, y = 0;
                    for (int i = begin; i <= end; i++)
                        switch (s[i])
                        {
                            case 'R':
                                x++;
                                break;

                            case 'L':
                                x--;
                                break;

                            case 'U':
                                y++;
                                break;

                            case 'D':
                                x--;
                                break;
                        }
                    if (x == 0 && y == 0)
                        ans++;
                }
            Console.Write(ans);
        }
    }
}


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29613.14
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Watermelon", "Watermelon.csproj", "{FE664089-017E-4CA2-8E32-05B760325D39}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU
		Release|Any CPU = Release|Any CPU
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{FE664089-017E-4CA2-8E32-05B760325D39}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{FE664089-017E-4CA2-8E32-05B760325D39}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{FE664089-017E-4CA2-8E32-05B760325D39}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{FE664089-017E-4CA2-8E32-05B760325D39}.Release|Any CPU.Build.0 = Release|Any CPU
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
	GlobalSection(ExtensibilityGlobals) = postSolution
		SolutionGuid = {33726527-E358-426C-802F-152BB8255C8E}
	EndGlobalSection
EndGlobal


using System;

namespace watermelon
{
    class Program
    {
        static void Main(string[] args)
        {
            int x = Console.Read();
            bool kt = (x > 2 && x % 2 < 1);
            Console.WriteLine((kt ? "YES" : "NO");
        }
    }
}


 class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();
            Regex regex = new Regex(@"hello*");
            Match match = regex.Match(input);
            if (match.Success)
            {
                Console.WriteLine("YES");
            }
            else
                Console.WriteLine("NO");
        }
    }


using System;
using System.RegularExpressions;

namespace Chat
{

  class ChattyBoy
  {

    static void Main(string[] args)
    {
      string s = Console.ReadLine();
      Regex condfilter = new Regex(s);
      if (condfilter.IsMatch("^\w*h*\w*e*\w*l{2,}\w*o*\w*$") == true)
        Console.WriteLine("YES");
      else Console.WriteLine("NO");

    }

  }

}


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

namespace YOLO
{
    class Program
    {
        static void Main(string[] args)
        {
            string x;
            x = Console.ReadLine();
            string cth = "hello";

            int index=0;
            for(int i=0; i<x.Length; i++){
                if(index==5){
                    break;
                }
                if(x[i]==cth[index]){
                    index++;
                }
                else if(x[i]==cth[index-1]){
                    continue;
                }
                else{
                    index = 0;
                }
            }

            if(index==5){
                Console.Write("YES");
            }
            else{
                Console.Write("NO");
            }

        }
    }
}


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

namespace YOLO
{
    class Program
    {
        static void Main(string[] args)
        {
            string x;
            x = Console.ReadLine();
            char[] cth = { 'h', 'e', 'l', 'l', 'o' };

            int index=0;
            for(int i=0; i<x.Length; i++){
                if(index==5){
                    break;
                }
                if(Char.ToLower(x[i])==cth[index]){
                    index++;
                }
                else if(Char.ToLower(x[i]==cth[index-1]) && index>0){
                    continue;
                }
                else{
                    index = 0;
                }
            }

            if(index==5){
                Console.Write("YES");
            }
            else{
                Console.Write("NO");
            }

        }
    }
}


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

namespace Problem460A {
    class Program {
        static void Main(string[] args) {
            string[] input = Console.ReadLine().Split(' ');
            int socks = Convert.ToInt32(input[0]);
            int newPair = Convert.ToInt32(input[1]);

            int days = 0;
            days += socks;
            int newSocks = days / newPair;
            days += newSocks;

            while (newSocks > 0) {
                int newSocks2 = newSocks / newPair;
                days += newSocks2;

                newSocks = newSocks2;
            }
            if (days % newPair == 0)
                days++;

            Console.WriteLine(days);
        }
    }
}


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

namespace code
{
    class Wight
    {

        static void Main(string[] args)
        {

            string input = Console.ReadLine();

            string word = "hello";

            int length = input.Length;
            int a = 0;
            int i, count = 0;
            for (i = 0; i < length; i++)
            {
                if (input[i] == word[a])
                {
                    a++;
                    count++;
                }
            }
            if (count == 5)
            {
                Console.WriteLine("YES");
            }
            else
            {
                Console.WriteLine("No");
            }

        }

    }

}