using System;
using System.Collections.Generic;

class Scanner
{
    string[] s;
    int i;

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

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

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

    public int nextInt()
    {
        return int.Parse(next());
    }

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

}

class Myon
{
    Scanner cin;
    Myon() { }

    public static void Main()
    {
        new Myon().calc();
    }

    int h, w;
    string[] s;
    int[,] num;
    int[,] usedcount;
    int count;
    int prenum = 0;

    void calc()
    {
        Scanner cin = new Scanner();
        int n, R, r;
        n = cin.nextInt();
        R = cin.nextInt();
        r = cin.nextInt();
        if (R < r)
        {
            Console.WriteLine("NO");
            return;
        }
        else if (n == 1)
        {
            Console.WriteLine("YES");
            return;
        }
        else if (R < 2 * r)
        {
            Console.WriteLine("NO");
            return;
        }
        else if (R == 2 * r)
        {
            if (n <= 2) Console.WriteLine("YES");
            else Console.WriteLine("NO");
            return;
        }
        double length = r * (R / 2.0) / (R / 2.0 - r / 2.0);
        double len2 = Math.Sqrt(2 * (R / 2.0) * (R / 2.0) - 2 * (R / 2.0) * (R / 2.0) * Math.Cos(Math.PI * 2 / n));
        //Console.WriteLine(length + " " + len2);
        if (length <= len2) Console.WriteLine("YES");
        else Console.WriteLine("NO");
    }

}


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

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

            int n = arr[0];
            double R = arr[1];
            double r = arr[2];

            //double midle = 2.0 * Math.PI * (R - r);
            //int maxCount = (int)(midle / (2.0 * r));

            double alfa = Math.Asin(r / (R - r));
            int maxCount = int.MaxValue;

            if (Double.IsNaN(alfa))
            {
                maxCount = 0;
            }
            else if (alfa != 0)
            {
                //maxCount = (int)Math.Round((Math.PI / alfa), MidpointRounding.AwayFromZero);
                maxCount = (int)((Math.PI / alfa) + 1e-6);
            }

            bool onePlate = (n == 1 && r <= R);

            if (n <= maxCount || onePlate)
            {
                Console.WriteLine("YES");
            }
            else
            {
                Console.WriteLine("NO");
            }
        }
    }
}


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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s1 = Console.ReadLine().Split(' ');
            int t = Int32.Parse(s1[0]);
            int s = Int32.Parse(s1[1]);
            double q = Int32.Parse(s1[2]);

            int count = 1;
            double memory = s;
            double tmp = s;

            while (t > 0)
            {
                memory += tmp * (q - 1);
                if (memory >= t)
                    break;
                else
                {
                    count++;
                    tmp = memory;
                }
            }
            Console.WriteLine(count);
            //Console.ReadKey();
        }
    }
}


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

namespace ConsoleApplication1
{
    public static class MainClass
    {
        const int BufferSize = (1 << 10) * 10;

        static readonly StreamReader Reader = new StreamReader(Console.OpenStandardInput(BufferSize), Encoding.ASCII, false, BufferSize);
        static readonly StreamWriter Writer = new StreamWriter(Console.OpenStandardOutput(BufferSize), Encoding.ASCII, BufferSize, false);

        static void Main(string[] args)
        {
            var array = ReadArray();
            var repeats = 0;

            while (array[1] < array[0])
            {
                array[1] *= array[2];
                repeats++;
            }

            Writer.WriteLine(repeats);
            Writer.Flush();
        }

        public static int ReadNumber()
        {
            return int.Parse(Reader.ReadLine());
        }

        public static long ReadLongNumber()
        {
            return long.Parse(Reader.ReadLine());
        }

        public static int[] ReadArray()
        {
            var inputLine = Reader.ReadLine().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);

            var resultArray = new int[inputLine.Length];
            for (var i = 0; i < inputLine.Length; i++)
            {
                resultArray[i] = int.Parse(inputLine[i]);
            }

            return resultArray;
        }
    }
}


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

public class Song
{
    public int Length { get; set; }
    public int Beauty { get; set; }

    public Song(int length, int beauty)
    {
        Length = length;
        Beauty = beauty;
    }
}

public class Test
{

    private static int ReadInt()
    {
        return Convert.ToInt32(Console.ReadLine());
    }

    private static long ReadLong()
    {
        return Convert.ToInt64(Console.ReadLine());
    }

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

    private static int[] ReadArray()
    {
        return Array.ConvertAll(Console.ReadLine().Split(' '), m => Convert.ToInt32(m));
    }
    public static void Main()
    {

        int N = ReadInt();

        int ans = 0;
        for(int i = 2; i < N; i++)
        {
            ans += i * (i + 1);
        }

        Console.WriteLine(ans);

    }

}


using System;

class _1140D
{
	static void Main()
	{
		int n = int.Parse(Console.ReadLine());

		int ans = 0;
		for (int i = 0; i < n - 2; ++i)
		{
			ans += (i + 2) * (i + 3);
		}
		Console.WriteLine(ans);
	}
}


using System;

namespace CodeF1
{
    class Program
    {
        private static bool Need(String s1, String s2)
        {
            var b = new bool[s1.Length];
            for (int i = 0; i < s2.Length; i++)
            {
                bool cont = false;
                for (int j = 0; j < s1.Length; j++)
                {
                    if (!b[j] && s1[j] == s2[i])
                    {
                        b[j] = true;

                        cont = true;
                        break;
                    }
                }
                if (!cont) return false;
            }
            return true;
        }

        private static bool NeedB(String s1, String s2)
        {
            var b = new bool[s1.Length];
            var JJ = 0;
            for (int i = 0; i < s2.Length; i++)
            {
                bool cont = false;
                for (int j = JJ; j < s1.Length; j++)
                {
                    JJ++;
                    if (!b[j] && s1[j] == s2[i])
                    {
                        b[j] = true;

                        cont = true;
                        break;
                    }
                }
                if (!cont) return false;
            }
            return true;
        }

        static void Main()
        {

            var str1 = Console.ReadLine();
            var str2 = Console.ReadLine();
            if (!Need(str1, str2))
            {
                Console.WriteLine("need tree");
                return;
            }

            bool auto = false;
            bool array = false;
            if (str1.Length != str2.Length)
            {
                auto = true;
            }

            if (!NeedB(str1, str2))
            {
                array = true;
            }

            if (array && auto)
            {
                Console.WriteLine("both");
                return;
            }

            if (auto)
            {
                Console.WriteLine("automaton");
                return;
            }

            if (array)
            {
                Console.WriteLine("array");
            }
        }
    }
}


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

namespace ConsoleApplication1
{
    public class Program
    {
        public static void Main()
        {
            string startString, endString;
            int original_Length, StartStrLength, i = 0;
            bool possible = true, automaton = true;

            startString = Console.ReadLine();
            endString = Console.ReadLine();

            original_Length = endString.Length;
            StartStrLength = startString.Length;

            //loop checks to see if our letters are in order even if there are extra ones
            //used for cases like "abacaba" with "aaaa", so code says automaton and not "both"
            for (int j = 0; j < original_Length - 1; ++j)
            {
                if (i >= StartStrLength - 1)
                    break;
                //search for letter, and make sure next letter is farther down from where we found previous one
                if (startString.IndexOf(endString[j], i) > startString.IndexOf(endString[j + 1], startString.IndexOf(endString[j],i) + 1))
                {
                    automaton = false;
                    break;
                }
                i = startString.IndexOf(endString[j], i) + 1;
            }

            if (original_Length > startString.Length)
                Console.WriteLine("need tree");
            else
            {
                if (startString.IndexOf(endString) != -1)
                    Console.WriteLine("automaton");
                else
                {
                    while (endString.Length != 0)
                    {
                        //makes sure our starting string has enough of specific characters for end string
                        if (endString.Count(n => n == endString[0]) > startString.Count(n => n == endString[0]))
                        {
                            possible = false;
                            break;
                        }
                        //gets rid of character just checked so we don't count the times a character appeared twice
                        endString = endString.Replace(Convert.ToString(endString[0]), "");
                    }

                    if (possible && original_Length == startString.Length)
                        Console.WriteLine("array");
                    else if (possible && automaton)
                        Console.WriteLine("automaton");
                    else if (possible)
                        Console.WriteLine("both");
                    else
                        Console.WriteLine("need tree");
                }
            }
        }
    }
}


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

public class EllysCheckers
{
    public static int [] time(string t)
    {
        int [] res = new int[t.Length];
        for (int i = 0; i < t.Length; i++) {

            if(t[t.Length - i - 1]>='A' && t[t.Length - i - 1] <= 'Z')
            {
                res[i] = (int)t[t.Length - i - 1] - 55;
            }
            else
            {
                res[i] = int.Parse(t[t.Length - i - 1].ToString());
            }
        }
        return res;

    }
    public static bool check(int[] t, int s, bool type )
    {
        int z = 1;
        int ans = 0;
        for (int i = 0; i < t.Length; i++) {
            if(t[i] >= s)
                return false;
            ans += t[i] * z;
            z *= s;
        }
        if(type)
            if(ans >= 24)
                return false;
            else
                return true;
        else
            if(ans >= 60)
                return false;
            else
                return true;
    }
    public static void Main(string[] args)
    {
        string []str = Console.ReadLine().Split(':').ToArray();
        string hour = str[0];
        string min = str[1];
        int [] h = time(hour);
        int [] m = time(min);
        if(check(h, 61, true) && check(m, 61, false))
        {
            Console.WriteLine (-1);
            return;
        }
        List<int> ans = new List<int>();
        for (int i = 2; i <=60; i++) {
            if(check(h, i, true) && check(m, i, false))
                ans.Add(i);
        }
        if(ans.Count == 0)
            Console.WriteLine (0);
        else
        {
            string pr = "";
            foreach (var item in ans) {
                Console.Write(pr + item);
                pr = " ";
            }
        }

    }

}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApp2
{
	class Program
	{
		static int dgt(char c)
		{
			if ('0' <= c && c <= '9')
			{
				return c - '0';
			}
			return 10 + c - 'A';
		}

		static int to_num(string s, int n)
		{
			int num = 0;
			int k = 1;
			for (int i = 1; i <= s.Length; i++)
			{
				num += dgt(s[s.Length - i]) * k;
				k *= n;
			}
			return num;
		}
		static bool fit(string s1, string s2, int n)
		{
			return to_num(s1, n) < 24 && to_num(s2, n) < 60;
		}

		static int get_min(string s)
		{
			int min = 0;
			for (int i = 0; i < s.Length; i++)
			{
				if (dgt(s[i]) > min)
				{
					min = dgt(s[i]);
				}
			}
			return min;
		}

		static void Main(string[] args)
		{
			string input = Console.ReadLine();
			var times = input.Split(':');
			int min = Math.Max(get_min(times[0]), get_min(times[1])) + 1;

			if (fit(times[0], times[1], 60))
			{
				Console.WriteLine(-1);
			}
			else
			{
				int i;
				for (i = min; i <= 59; i++)
				{
					if (!fit(times[0], times[1], i))
						break;
					Console.Write("{0} ", i);
				}
				if (i == min)
					Console.WriteLine(0);
			}
		}
	}
}


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

namespace Symmetric_and_Transitive
{
    internal class Program
    {
        private const int mod = 1000000007;
        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 readonly int[,] C = new int[4000,4000];
        private static readonly long[] a = new long[4001];

        private static long GetC(int n, int k)
        {
            if (n < k)
            {
                int c = k;
                k = n;
                n = c;
            }
            if (k == 0 || k == n)
                return 1;

            if (C[n, k] != 0)
                return C[n, k];

            return C[n, k] = (int)((GetC(n - 1, k - 1) + GetC(n - 1, k))%mod);
        }

        private static long A(int n)
        {
            if (n == 1)
                return 1;

            if (a[n] == 0)
            {
                //a(n+1) = 1 + sum { j=1, n, (1+binomial(n, j))*a(j)
                a[n] = 1;
                for (int j = 1; j < n; j++)
                {
                    a[n] = (a[n] + (1 + GetC(n - 1, j))*A(j))%mod;
                }
            }

            return a[n];
        }

        private static void Main(string[] args)
        {
            int n = Next();
            writer.WriteLine(A(n)%mod);
            writer.Flush();
        }

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


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

namespace ConsoleApplication10
{

       class Program
    {
           public const int MOD = 1000000007;

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

            C[0] = new int[1];
            C[0][0] = 1;
            int[] prewrow =  C[1] = new int[2];
            prewrow[0] = 1;
            prewrow[1] = 1;
            for (int i = 2; i <= n; i++)
            {
                int[] row = C[i] = new int[i+1];
                row[i] = 1;
                row[0] = 1;
                for(int j = 1; j <i; j++)
                {
                    row[j] = (prewrow[j] + prewrow[j - 1])%MOD;
                }
                prewrow = row;
            }

            long[][] E = new long[n + 1][];
            long[] prow = E[0] = new long[1];
            prow[0] = 1;
            for (int i = 1; i <= n; i++)
            {
                long[] row = E[i] = new long[i + 1];
                row[i] = 1;
                row[0] = 0;
                for (int j = 1; j < i; j++)
                {
                    row[j] = (prow[j] * j + prow[j - 1]) % MOD;
                }
                prow = row;
            }

            long[] total = new long[n + 1];
            for(int i = 0; i <= n; i++)
            {
                long sum = 0;
                long[] row = E[i];
                 for (int j = 0; j <= i; j++)
                 {
                     sum = (sum + row[j]) %MOD;
                 }
                total[i] = sum;
            }

            long result = 0;
            for (int i = 1; i <= n; i++ )
            {
                result = (result + C[n][i] * total[n - i]) % MOD;
            }

            Console.WriteLine(result);
        }
    }
}


using System;
using System.Collections.Generic;
using System.Globalization;
using System.Runtime.InteropServices.ComTypes;
using System.Text;

namespace _300
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            string t = "CODEFORCES";
            bool f = false;
            for (int i = 0; i < s.Length; i++)
            {
                for (int j = 0; j < s.Length; j++)
                {
                    string ss = s;
                    if(i+j<=s.Length)
                    ss=ss.Remove(i,j);
                    if (ss == t)
                    {
                        f = true;
                        break;
                    }
                }
                if(f)break;

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


using System;

namespace cfcs
{
    class Program
    {
        const string cf = "CODEFORCES";

        static string solve()
        {
            int i;
            string s = Console.ReadLine();

            if (s.Length < cf.Length) return "NO";

            for (i = 0; i < cf.Length; i++)
                if (cf[i] != s[i]) break;

            for (int j = 0; j < cf.Length - i; j++)
                if (cf[cf.Length - 1 - j] != s[s.Length - 1 - j]) return "NO";

            return "YES";
        }

        static void Main()
        {
            Console.WriteLine(solve());
        }
    }
}


using System;
using System.Linq;

namespace CSharp
{
    class _96B
    {
        public static void Main()
        {
            int n = int.Parse(Console.ReadLine());

            for (int d = n.ToString().Length; ; d++)
            {
                for (int i = 0; i < Math.Pow(2, d); i++)
                {
                    long candidate = long.Parse(Convert.ToString(i, 2).PadLeft(d, '0').Replace('0', '4').Replace('1', '7'));
                    if (candidate >= n && candidate.ToString().GroupBy(c => c).All(g => g.Count() == d / 2))
                    {
                        Console.WriteLine(candidate);
                        return;
                    }
                }
            }
        }
    }
}


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

namespace Lucky_Numbers
{
    class Program
    {
        public static UInt64 n = 0;
        static void Main(string[] args)
        {
            UInt64 x1 = UInt64.Parse(Console.ReadLine());
            n=x1;
            Console.WriteLine(recur(0, 0, 0));
        }
        static UInt64 recur( UInt64 x, UInt64 fours, UInt64 sevens)
        {
            if (fours == sevens && x > 0 && x >= n)
            {
                return x;
            }
            else if (x > (1000000000))
                return UInt64.MaxValue;
            {}
            UInt64 x1 = recur(x * 10 + 4, fours + 1, sevens);
            UInt64 x2 = recur(x * 10 + 7, fours , sevens+1);
            return Math.Min(x1, x2);

        }
    }
}


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

namespace Codeforces645A
{
    class Program
    {
        static void Main(string[] args)
        {
            string inp1 = Console.ReadLine();
            string inp2 = Console.ReadLine();
            string inp3 = Console.ReadLine();
            string inp4 = Console.ReadLine();

            string exp1 = "", exp2 = "";

            exp1 = inp1.Substring(0, 1) + inp1.Substring(1, 1) + inp2.Substring(1, 1) + inp2.Substring(0, 1);
            exp1 = exp1.Remove(exp1.IndexOf('X'),1);
            int ind = exp1.IndexOf('A');
            if(ind !=0)
                exp1 = exp1.Substring(ind) + exp1.Remove(ind);

            exp2 = inp3.Substring(0, 1) + inp3.Substring(1, 1) + inp4.Substring(1, 1) + inp4.Substring(0, 1);
            exp2 = exp2.Remove(exp2.IndexOf('X'),1);
            ind = exp2.IndexOf('A');
            if (ind != 0)
                exp2 = exp2.Substring(ind) + exp2.Remove(ind);

            string outp = exp1 == exp2 ? "YES" : "NO";

            Console.WriteLine(outp);
            //inp1 = Console.ReadLine();
        }
    }
}


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

namespace Codeforces_645
{
    class Program
    {
        static void Main(string[] args)
        {
            string B = Console.ReadLine(), B2 = Console.ReadLine();
            string E = Console.ReadLine(), E2 = Console.ReadLine();
            B += B2[1]; B += B2[0]; B = B.Replace("X", "");
            E += E2[1]; E += E2[0]; E = E.Replace("X", "");
            bool b = (B + B).IndexOf("AB") < 0;
            bool e = (E + E).IndexOf("AB") < 0;
            Console.WriteLine(b == e ? "YES" : "NO");
        }
    }
}


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

namespace CodeForces
{
    class R198_Div2_A
    {
        static int GCD(int a, int b)
        {
            if (b == 0) return a;
            return GCD(b, a % b);
        }
        static int LCM(int a, int b)
        {
            return a * b / GCD(a, b);
        }

        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            int x = int.Parse(s[0]);
            int y = int.Parse(s[1]);
            int a = int.Parse(s[2]);
            int b = int.Parse(s[3]);

            int lcm = LCM(x, y);
            int f = -1, l = -1;

            f = (a / lcm) * lcm;
            l = (b / lcm) * lcm;

            if (f < a) f += lcm;
            int cnt = 0;
            if (f <= l)
                cnt = (l - f) / lcm + 1;

            Console.WriteLine(cnt);
        }
    }
}


using System;
using System.Linq;
using System.Numerics;

namespace Codeforces
{
	class Program
	{
		static void Main(string[] args)
		{
			string input = Console.ReadLine();
			var inputs = input.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries);

			var numbers = inputs.Select(long.Parse).ToArray();
			var lcm = LCM(numbers[0], numbers[1]);

			Console.WriteLine(numbers[3] / lcm - (numbers[2] - 1) / lcm);
		}

		private static long GCD(long a, long b)
		{
			long max = Math.Max(a, b);
			long min = Math.Min(a, b);

			if (min == 0)
			{
				return max;
			}

			a = min;
			b = max % min;
			return GCD(a, b);
		}

		private static long LCM(long a, long b)
		{
			return Math.Abs(a * b) / GCD(a, b);
		}

		//private static int Length(short[] a)
		//{
		//	int firstItemIndex = 0;
		//	for (int i = 0; i < a.Length; i++)
		//	{
		//		if (a[i] == 0)
		//		{
		//			continue;
		//		}

		//		firstItemIndex = i;
		//		break;
		//	}

		//	return a.Length - firstItemIndex;
		//}

		//private static short[] Subtract(short[] a, short[] b)
		//{
		//	if (a.Length != b.Length)
		//	{
		//		throw new ArgumentException();
		//	}

		//	short[] result = new short[a.Length];
		//	Array.Copy(a, result, a.Length);
		//	for (int i = result.Length - 1; i >= 0; i--)
		//	{
		//		if (result[i] < b[i])
		//		{
		//			int j = i - 1;
		//			while (result[j] == 0)
		//			{
		//				result[j--] = 9;
		//			}

		//			result[j]--;
		//			result[i] += 10;
		//		}

		//		result[i] -= b[i];
		//	}

		//	return result;
		//}

		//private static short[] Multiply(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	for (int i = a.Length - 1; i > 0; i--)
		//	{
		//		int temp = a[i] * b;
		//		result[i] = (short)(result[i] + temp % 10);
		//		result[i - 1] = (short)(result[i - 1] + temp / 10);
		//	}

		//	return result;
		//}

		//private static int Mod(short[] a, int b)
		//{
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		rest = d % b;
		//		i++;
		//	}

		//	return rest;
		//}

		//private static short[] Divide(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		result[i] = (short)(d / b);
		//		rest = d % b;
		//		i++;
		//	}

		//	return result;
		//}
	}
}


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

class Program
{
    static void Main()
    {
        string input = Console.ReadLine();
        if (input.Length < 3 || !input.Contains('@')) { Console.WriteLine("NO"); return; };

        string[] splited = input.Split('@','/');
        if (splited.Length < 2 || splited.Length > 3) { Console.WriteLine("NO"); return; }
        string username = splited[0], hostname = splited[1];
        string resource = "***";
        if(splited.Length == 3)
        {
            resource = splited[2];
        }

        bool correct = CheckCorrectSymbols(username,hostname,resource);
        if (correct) Console.WriteLine("YES");
        else Console.WriteLine("NO");

    }
    static bool CheckCorrectSymbols(string username, string hostname, string resource)
    {
        string EngABC = "_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";

        if (username.Length < 1 || username.Length > 16) return false;
        for (int i = 0; i < username.Length; ++i)
        {
            if (!EngABC.Contains(username[i])) return false;
        }

        if (hostname.Length < 1 || hostname.Length > 32) return false;
        for (int i = 0; i < hostname.Length; ++i)
        {
            if (hostname[i] != '.' && !EngABC.Contains(hostname[i])) return false;
        }

        string[] words = hostname.Split('.');
        if (words.Length < 1) return false;
        for (int i = 0; i < words.Length; ++i)
        {
            if (words[i].Length < 1 || words[i].Length > 16) return false;
        }

        if (resource != "***")
        {
            if (resource.Length < 1 || resource.Length > 16) return false;
            for (int i = 0; i < resource.Length; ++i)
            {
                if (!EngABC.Contains(resource[i])) return false;
            }
        }

        return true;
    }

}


using System;
using System.Collections.Generic;
class some
{
	public static void Main()
	{
		string []s=Console.ReadLine().Split(new char[]{'@'});
		bool y=find(s);
		if(y)Console.WriteLine("YES");
		else
		Console.WriteLine("NO");
	}
	public static bool find(string[] s)
	{

		if(s.Length<2 || s.Length>2)return false;
		string user=s[0];
		string [] rest=s[1].Split('/');
		string host=rest[0];
		if(!(host.Length>0 && host.Length<33))return false;
		if(!(user.Length>0 && user.Length<17))return false;
		foreach(char cc in user)
		{
			if(!(char.IsDigit(cc) || char.IsLetter(cc) || cc=='_'))return false;
		}
		foreach(char cc in host)
		{
			if(!(char.IsDigit(cc) || char.IsLetter(cc) || cc=='_' || cc=='.'))return false;
		}
		string [] tt=host.Split(new char[]{'.'});
		foreach(string t in tt)
		{
			if(!(t.Length>0 && t.Length<17))return false;
		}
		List<string> ll=new List<string>();int le=0;
		if(rest.Length>1)
		{
			for(int i=1;i<rest.Length;i++)
			{
				ll.Add(rest[i]);le+=rest[i].Length;
			}
			if(!(le>0 && le<17))return false;

			foreach(string kk in ll)
			{
				foreach(char cc in kk)
				{
					if(!(char.IsDigit(cc) || char.IsLetter(cc) || cc=='_'))return false;
				}
			}
		}

		return true;
	}
}


using System;
using CompLib.Util;

public class Program
{
    public void Solve()
    {
        var sc = new Scanner();
        int a1 = sc.NextInt();
        int a2 = sc.NextInt();
        int k1 = sc.NextInt();
        int k2 = sc.NextInt();
        int n = sc.NextInt();

        // 全員退場しないギリギリ
        int tmp = a1 * (k1 - 1) + a2 * (k2 - 1);
        int min = Math.Min(a1 + a2, Math.Max(0, n - tmp));

        int max = 0;

        if (k1 <= k2)
        {
            int d1 = Math.Min(a1, n / k1);
            max += d1;
            n -= d1 * k1;

            int d2 = Math.Min(a2, n / k2);
            max += d2;
        }
        else
        {
            int d1 = Math.Min(a2, n / k2);
            max += d1;
            n -= d1 * k2;

            int d2 = Math.Min(a1, n / k1);
            max += d2;
        }

        Console.WriteLine($"{min} {max}");
    }

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

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

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

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

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

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

            return _line[_index++];
        }

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

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

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


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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int a1=int.Parse(Console.ReadLine());
            int a2=int.Parse(Console.ReadLine());
            int k1=int.Parse(Console.ReadLine());
            int k2=int.Parse(Console.ReadLine());
            int n=int.Parse(Console.ReadLine());
            int e1=(k1-1)*a1;
            int e2=(k2-1)*a2+e1;
            int min=n-e2;
            if(min<0)
            min=0;
            int max=0;
            int o=0;
            int u=0;
            if(k1<k2)
            {
                 while(n>0&&a1>0)
                 {
                    o++;
                    n--;
                    if(o>=k1)
                    {
                         o=0;
                         u++;
                         a1--;
                    }
                 }
                 o=0;
                 while(n>0&&a2>0)
                 {
                    o++;
                    n--;
                    if(o>=k2)
                    {
                         o=0;
                         u++;
                         a2--;
                    }
                 }

            }
            else
            {
                 while(n>0&&a2>0)
                 {
                    o++;
                    n--;
                    if(o>=k2)
                    {
                         o=0;
                         u++;
                         a2--;
                    }
                 }
                 o=0;
                 while(n>0&&a1>0)
                 {
                    o++;
                    n--;
                    if(o>=k1)
                    {
                         o=0;
                         u++;
                         a1--;
                    }
                 }
            }

            Console.Write("{0} {1}",min,u);
        }

    }
}


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

namespace CodeForces
{
    class R195_Div2_A
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            int x = int.Parse(s[0]);
            int y = int.Parse(s[1]);

            if (x > 0 && y > 0)
                Console.WriteLine("0 " + (x+y) + " " + (x+y) + " 0");
            else if (x < 0 && y > 0)
                Console.WriteLine((x-y) + " 0 0 " + (y - x));
            else if (x < 0 && y < 0)
                Console.WriteLine((x + y) + " 0 0 " + (x + y));
            else if (x > 0 && y < 0)
                Console.WriteLine(" 0 " + (y - x) + " " + (x-y) + " 0");
        }
    }
}


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

namespace CodeForces
{
    class Solution
    {
        static int Main(string[] args)
        {
            int[] xy = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            int x1 = Math.Abs(xy[0]) + Math.Abs(xy[1]);
            int y2 = x1;
            if (xy[0] < 0)
            {
                x1 *= -1;
            }
            if (xy[1] < 0)
            {
                y2 *= -1;
            }
            int y1 = 0;
            int x2 = 0;
            if (x1 < x2)
            {
                Console.WriteLine("{0} {1} {2} {3}", x1, y1, x2, y2);
            }
            else
            {
                Console.WriteLine("{0} {1} {2} {3}", x2, y2, x1, y1);
            }

            return 0;
        }
    }
}


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

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

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

        private static int Solve(string[] args)
        {
            int A = Next(), B = Next(), C = Next(), N = Next();

            if (A > N || B > N || C > A || C > B)
                return -1;

            int ans = N - A - B + C;
            if (ans > 0)
                return ans;
            return -1;
        }

        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;

namespace CSharp
{
    public class _991A
    {
        public static void Main()
        {
            string[] tokens = Console.ReadLine().Split();

            int a = int.Parse(tokens[0]);
            int b = int.Parse(tokens[1]);
            int c = int.Parse(tokens[2]);
            int n = int.Parse(tokens[3]);

            if (a + b - c > n | c > a || c > b)
            {
                Console.WriteLine(-1);
            }
            else
            {
                int failed = n - a - b + c;
                Console.WriteLine(failed <= 0 ? -1 : failed);
            }
        }
    }
}


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

namespace Escape
{
    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 vp = Next(), vd = Next(), t = Next(), f = Next(), c = Next();

            t *= vp*vd;
            f *= vp * vd;
            c *= vp * vd;

            int count = 0;
            int p = 0;
            int d = 0;
            int ds = 0;
            int towait = t;
            while (true)
            {
                p += vp;

                if (ds == 0)
                {
                    towait--;
                    if (towait < 0)
                    {
                        ds = 1;
                        d += vd;
                    }
                }
                else if (ds == 1)
                {
                    d += vd;
                }
                else
                {
                    d -= vd;
                }

                if (d >= p)
                {
                    if (d==p &&p==c)
                        break;
                    count++;
                    ds = 2;
                    d = p - (d - p);
                }

                if (ds == 2 && d <= 0)
                {
                    d = -d;
                    ds = 0;
                    towait = f;
                }

                if (p >= c)
                {
                    break;
                }
            }

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

namespace CF105D2B
{
    class CF105D2B
    {
        public static void Main(string[] args)
        {
            EasyScanner sc = new EasyScanner(Console.In);
            double vp = sc.NextInt();
            double vd = sc.NextInt();
            double t = sc.NextInt();
            double f = sc.NextInt();
            double c = sc.NextInt();

            if (vp >= vd)
            {
                Console.Out.WriteLine(0);
                return;
            }

            double x = vp * t;
            x += vp * (x / (vd - vp));

            int count = 0;
            while (x < c)
            {
                count++;
                x += vp * (x / vd);
                x += vp * f;
                x += vp * (x / (vd - vp));
            }
            Console.Out.WriteLine(count);
        }
    }

    class EasyScanner
    {
        private TextReader reader;
        private Queue<string> tokens;

        public EasyScanner(TextReader reader)
        {
            this.reader = reader;
            this.tokens = new Queue<string>();
        }

        private void MaybeReadLine()
        {
            if (tokens.Count > 0)
            {
                return;
            }
            string line = reader.ReadLine();
            foreach (string token in line.Split())
            {
                tokens.Enqueue(token);
            }
        }

        public int NextInt()
        {
            MaybeReadLine();
            string token = tokens.Dequeue();
            return int.Parse(token);
        }

        public long NextLong()
        {
            MaybeReadLine();
            string token = tokens.Dequeue();
            return long.Parse(token);
        }

        public double NextDouble()
        {
            MaybeReadLine();
            string token = tokens.Dequeue();
            return double.Parse(token);
        }

        public string NextString()
        {
            MaybeReadLine();
            string token = tokens.Dequeue();
            return token;
        }
    }
}


using System;

public class Program
{
	public static void Main()
	{
		string input = Console.ReadLine();
		string normalized = "";
		int count = 0;
		foreach(var item in input)
		{
			if(item != '/')
			{
				normalized += item.ToString();
				count = 0;
			}
			else if(count == 0)
			{
				normalized += item.ToString();
				count++;
			}
		}

		string result = normalized;
		if(normalized.Length > 1 && normalized[normalized.Length - 1] == '/')
		{
			result = normalized.Substring(0, normalized.Length - 1);
		}

		Console.WriteLine(result);
	}
}


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

namespace CodeForces
{
    static class Reader
    {
        public static int NextInt()
        {
            int ret = 0;
            char c;

            while (!char.IsDigit(c = (char)Console.Read()))
            {
                if (c == '-')
                    return -NextInt();
            }
            do
            {
                ret = ret * 10 + c - '0';
            } while (char.IsDigit(c = (char)Console.Read()));

            return ret;
        }

        public static double NextDouble()
        {
            double ret = 0;
            char c;

            while (!char.IsDigit(c = (char)Console.Read()))
            {
                if (c == '-')
                    return -NextDouble();
            }
            do
            {
                ret = ret * 10 + c - '0';
            } while (char.IsDigit(c = (char)Console.Read()));
            if (c != '.') return ret;

            double p10 = 0.1;
            while (char.IsDigit(c = (char)Console.Read()))
            {
                ret += p10 * (c - '0');
                p10 *= 0.1;
            }

            return ret;
        }

        public static string NextToken()
        {
            StringBuilder ret = new StringBuilder();
            char c;

            while (char.IsWhiteSpace(c = (char)Console.Read())) ;
            do
            {
                ret.Append(c);
            } while (!char.IsWhiteSpace(c = (char)Console.Read()));

            return ret.ToString();
        }
    }

    class Program
    {
        static void Main(string[] args)
        {
            string s = Reader.NextToken();
            while (s != s.Replace("//", "/"))
                s = s.Replace("//", "/");
            if (s.Length > 1 && s.EndsWith("/"))
                s = s.Substring(0, s.Length - 1);
            Console.WriteLine(s);
        }
    }
}


using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;
class Program{
	static void Main() {
		int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray();
		int[] b = Console.ReadLine().Split().Select(int.Parse).ToArray();
		int[] c = Console.ReadLine().Split().Select(int.Parse).ToArray();
		long[] v1 = new long[2]{b[0] - a[0], b[1] - a[1]};
		long[] v2 = new long[2]{c[0] - b[0], c[1] - b[1]};
		long product = (v1[0] * v2[1]) - (v1[1] * v2[0]);

		if(product == 0)
			Console.WriteLine("TOWARDS");
		else if(product > 0)
			Console.WriteLine("LEFT");
		else
			Console.WriteLine("RIGHT");
	}
}


using System;

namespace ConsoleApplication1
{
    public class Program
    {
        static void Main()
        {
            string[] a = Console.ReadLine().Split(' '),
                     b = Console.ReadLine().Split(' '),
                     c = Console.ReadLine().Split(' ');
            string k = Solver(Int32.Parse(a[0]), Int32.Parse(a[1]), Int32.Parse(b[0]),
                              Int32.Parse(b[1]), Int32.Parse(c[0]), Int32.Parse(c[1]));
            Console.WriteLine(k);
        }

        public static string Solver(int ax, int ay, int bx, int by, int cx, int cy)
        {

            Int64[,] mat = new Int64[3, 3] { { 1, 1, 1 }, { bx - ax, by - ay, 0 }, { cx - bx, cy - by, 0 } };
            Int64 k = mat[1, 0] * mat[2, 1] - mat[1, 1] * mat[2, 0];
            if (k > 0) return "LEFT";
            if (k < 0) return "RIGHT";
            return "TOWARDS";

        }
    }
}


using System;

namespace _887B
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = 0;
            n = int.Parse(Console.ReadLine());
            int[,] array = new int[n, 6];
            for (int i = 0; i < n; i++)
            {
                //Console.Clear();
                string inputDice = Console.ReadLine();
                string[] splitInputDice =  inputDice.Split(' ');

                for (int j = 0; j < 6; j++)
                {
                    array[i, j] = int.Parse(splitInputDice[j]);
                }
            }

            int[] checker = new int[1000];
            Array.Clear(checker, 0, checker.Length);

            for (int i = 0; i < n; i++)
            {
                for(int j = 0; j < 6; j++)
                {
                    checker[array[i, j]] = 1;

                    for(int k = 0; k < n; k++ )
                    {
                        if (k == i) continue;
                        for(int l = 0; l < 6; l++)
                        {
                            int index = array[i, j] * 10 + array[k, l];
                            checker[index] = 1;
                            for(int m = 0; m < n; m++)
                            {
                                if (m == i || m == k) continue;
                                for(int o = 0; o < 6; o++)
                                {
                                    int index2 = array[i, j] * 100 + array[k, l] * 10 + array[m, o];
                                    checker[index2] = 1;
                                }
                            }
                        }
                    }
                }
            }

            int res = 0;
            for(int i = 1; i < 1000; i++)
            {
                if(checker[i] == 0)
                {
                    res = i - 1;
                    break;
                }
            }

            Console.Write(res);

        }
    }
}


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

namespace ConsoleApp14
{
    class Program
    {
        static void Main(string[] args)
        {
            int num2 = 0;
            int n = int.Parse(Console.ReadLine());
            int[][] toks = new int[3][];

            for(int i = 0; i < n; i++)
            {
                int[] temp = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
                toks[i] = temp;
            }

            int number = 0;
            for(int x = 0; x <= 10000; x++)
            {
                number++;
                string tofind = number.ToString();
                int num1 = int.Parse(tofind[0].ToString());
                if (tofind.Length == 2)
                {
                    num2 = int.Parse(tofind[1].ToString());
                }
                bool naid = false;
                for(int i = 0; i < n; i++)
                {
                    if(toks[i].Contains(num1))
                    {
                        naid = true;
                        if(tofind.Length == 1)
                        {
                            break;
                        }
                        else
                        {
                            naid = false;
                            for(int j = 0; j < n; j++)
                            {
                                if (j == i)
                                    continue;
                                if(toks[j].Contains(num2))
                                {
                                    naid = true;
                                    i = n;
                                    break;
                                }
                            }
                        }
                    }
                }
                if (naid == false)
                    break;

            }
            Console.WriteLine(--number);
            Console.ReadLine();
        }
    }
}


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

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

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

        private static int Solve(string[] args)
        {
            string s = reader.ReadLine();

            int min = Math.Min(Math.Min(Check(s, '0', '0'), Check(s, '2', '5')), Math.Min(Check(s, '5', '0'), Check(s, '7', '5')));
            if (min == int.MaxValue)
                return -1;

            return min;
        }

        private static int Check(string s, char c1, char c2)
        {
            int index = s.LastIndexOf(c2);
            if (index < 0)
                return int.MaxValue;
            int ans = s.Length - index - 1;
            int index2;
            if (c1 == c2)
                index2 = s.Substring(0, index).LastIndexOf(c1);
            else
                index2 = s.LastIndexOf(c1);

            if (index2 < 0)
                return int.MaxValue;

            if (index2 > index)
                ans += s.Length - index2 - 1;
            else
                ans += s.Length - index2 - 2;

            var b = new StringBuilder();
            for (int i = 0; i < s.Length; i++)
            {
                if (i == index || i == index2)
                    continue;
                b.Append(s[i]);
            }

            bool f = b.Length == 0;
            for (int i = 0; i < b.Length; i++)
            {
                if (b[i] != '0')
                {
                    f = true;
                    break;
                }
                ans++;
            }

            if (f)
                return ans;

            return int.MaxValue;
        }
    }
}


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

public class Program
{

    public void Solve()
    {
        var sc = new Scanner();
        var n = sc.Next().Reverse().ToArray();
        if (n.Length == 1)
        {
            Console.WriteLine("-1");
            return;
        }

        // 先頭0以外
        // 下2桁 00 25 50 75

        int ans = int.MaxValue;

        // 先頭
        for (int i = 0; i < n.Length; i++)
        {
            if (n[i] == '0') continue;
            // 2桁目
            for (int j = 0; j < n.Length; j++)
            {
                if (n.Length > 2 && i == j) continue;
                for (int k = 0; k < n.Length; k++)
                {
                    if (i == k || j == k) continue;

                    bool zero = n[j] == '0' && n[k] == '0';
                    bool twentyfive = n[j] == '2' && n[k] == '5';
                    bool fifty = n[j] == '5' && n[k] == '0';
                    bool seventyfive = n[j] == '7' && n[k] == '5';
                    if (!zero && !twentyfive && !fifty && !seventyfive) continue;
                    var array = new int[n.Length];
                    for (int l = 0; l < n.Length; l++)
                    {
                        if (l == i) array[l] = 0;
                        else if (l == j) array[l] = 2;
                        else if (l == k) array[l] = 3;
                        else array[l] = 1;
                    }
                    int tmp = 0;
                    var bit = new FenwickTree(4);
                    for (int l = 0; l < n.Length; l++)
                    {
                        tmp += bit.Sum(array[l]);
                        bit.Add(array[l], 1);
                    }
                    ans = Math.Min(ans, tmp);
                }
            }
        }
        if (ans == int.MaxValue) Console.WriteLine("-1");
        else Console.WriteLine(ans);
    }

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

namespace CompLib.Collections
{
    using Num = System.Int32;

    public class FenwickTree
    {
        private readonly Num[] _array;
        public readonly int Count;

        public FenwickTree(int size)
        {
            _array = new Num[size + 1];
            Count = size;
        }

        /// <summary>
        /// A[i]にnを加算
        /// </summary>
        /// <param name="i"></param>
        /// <param name="n"></param>
        public void Add(int i, Num n)
        {
            i++;
            for (; i <= Count; i += i & -i)
            {
                _array[i] += n;
            }
        }

        /// <summary>
        /// [0,r)の和を求める
        /// </summary>
        /// <param name="r"></param>
        /// <returns></returns>
        public Num Sum(int r)
        {
            Num result = 0;
            for (; r > 0; r -= r & -r)
            {
                result += _array[r];
            }

            return result;
        }

        // [l,r)の和を求める
        public Num Sum(int l, int r) => Sum(r) - Sum(l);
    }
}

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

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

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

        public string Next()
        {
            while (_index >= _line.Length)
            {
                _line = Console.ReadLine().Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

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

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

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


using System;

namespace _535A
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            string[] translate1 = { "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine",
                                     "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen",
                                 "eighteen", "nineteen"};
            string[] translate2 = { "", "", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety" };
            if (n <= 19) Console.WriteLine(translate1[n]);
            else if (n % 10 == 0) { Console.WriteLine(translate2[n/10]); }
            else { Console.WriteLine(translate2[n/10]+"-"+translate1[n%10]); }

        }
    }
}


using System;

namespace _535A
{
    class Program
    {
        static string[] zeroToNine = new[] { "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine" };
        static string[] tenToNineteen = new[] { "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen" };
        static string[] decades = new[] { "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety" };
        static void Main(string[] args)
        {
            int s = int.Parse(Console.ReadLine());
            string result;
            if (s < 10)
                result = zeroToNine[s];
            else if (s >= 10 && s < 20)
                result = tenToNineteen[s - 10];
            else
            {
                result = decades[s / 10 - 2];
                if (s % 10 > 0)
                    result += '-' + zeroToNine[s % 10];
            }
            Console.WriteLine(result);
        }
    }
}


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

namespace Codeforces
{
	class Program
	{
		static void Main(string[] args)
		{
			int x2 = int.Parse(Console.ReadLine());
			int px2 = maxPrimeDivs(x2);
			int min = x2;
			int start2 = ((x2 / px2) - 1) * px2 + 1;

			for (int x1 = start2; x1 <= x2; x1++)
			{
				int px1 = maxPrimeDivs(x1);
				int start1 = ((x1 / px1) - 1) * px1 + 1;
				if (start1 > 2 && start1 < min)
				{
					min = start1;
				}
			}
			Console.WriteLine(min);
			Console.ReadLine();
		}

		private static int maxPrimeDivs(int n)
		{
			int d = 2;
			int result = 0;

			while (d * d <= n)
			{
				if (n % d == 0)
				{
					n /= d;
					if (result < d)
						result = d;
				}
				else d++;
			}
			return Math.Max(result, n);
		}

	}
}


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

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

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

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

            var nn = new int[n + 1];
            for (int i = 2; i < nn.Length; i++)
            {
                if (nn[i] == 0)
                {
                    for (int j = i; j < nn.Length; j += i)
                    {
                        nn[j] = i;
                    }
                }
            }

            int min = n;
            for (int j = n - nn[n] + 1; j <= n; j++)
            {
                if (nn[j] != j)
                {
                    min = Math.Min(min, j - nn[j] + 1);
                }
            }

            return min;
        }

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


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

namespace Кратные
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] str;
            str = Console.ReadLine().Split(' ');
            int y=Convert.ToInt32(str[0]), b=Convert.ToInt32(str[1]), r=Convert.ToInt32(str[2]), max=y;
            max = Math.Min(max, b - 1);
            max = Math.Min(max, r - 2);

                Console.WriteLine(3*max+3);

                //     Console.ReadKey();

        }
    }
}


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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string[]y=Console.ReadLine().Split(' ');
            int[]a=new int[3];
            a[0]=1;
            a[1]=2;
            a[2]=3;
            int sum=0;
            while(true)
            {
                 if((a[0]>=int.Parse(y[0]))||(a[1]>=int.Parse(y[1]))||(a[2]>=int.Parse(y[2])))
                 {
                      sum=a[0]+a[1]+a[2];
                      break;
                 }
                 else
                 {
                 a[0]++;
                 a[1]++;
                 a[2]++;
            }
            }
            Console.WriteLine(sum);

        }
    }
}


using System;
using System.Linq;

namespace Task_C
{
    class Program
    {
        private static int CardIndex(string card)
        {
            var num = card[1] - '1';
            int color = 0;
            if (card[0] == 'R')
                color = 0;
            if (card[0] == 'G')
                color = 1;
            if (card[0] == 'B')
                color = 2;
            if (card[0] == 'Y')
                color = 3;
            if (card[0] == 'W')
                color = 4;

            var index = (1 << num) | (1 << (color + 5));
            return index;
        }

        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            var cards = Console.ReadLine().
                Split().
                Distinct().
                Select(x => CardIndex(x)).
                ToList();

            var minSuggest = int.MaxValue;

            var maxSuggest = 1 << 10;
            for (int suggest = 0; suggest < maxSuggest; suggest++)
            {
                var distinctCard = cards.Select(x => x & suggest).Distinct().Count();
                if (distinctCard == cards.Count)
                {
                    var suggestSize = SparseBitcount(suggest);
                    if (suggestSize < minSuggest)
                    {
                        minSuggest = suggestSize;
                    }
                }
            }

            Console.WriteLine(minSuggest);
        }

        static int SparseBitcount(int n)
        {
            int count = 0;
            while (n != 0)
            {
                count++;
                n &= (n - 1);
            }
            return count;
        }
    }
}


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

public class Test
{
    [Flags]
    enum Card
    {
        R = 1 << 0,
        G = 1 << 1,
        B = 1 << 2,
        Y = 1 << 3,
        W = 1 << 4,
        One = 1 << 5,
        Two = 1 << 6,
        Three = 1 << 7,
        Four = 1 << 8,
        Five = 1 << 9,
    }

    public static void Main()
    {
        int result = Solve();
        Console.WriteLine(result);
    }

    static int Solve()
    {

        // Don't care for n
        Console.ReadLine();

        var input = Console.ReadLine().Split(' ').Distinct().Select(x => ParseCard(x)).ToArray();
        if (input.Length == 1)
        {
            return 0;
        }
        List<Card> diffs = new List<Card>(input.Length * input.Length);
        for(int i = 0; i < input.Length - 1; i++)
        {
            for(int j = i + 1; j < input.Length; j++)
            {
                Card diff = Diff(input[i], input[j]);
                diffs.Add(diff);
            }
        }

        var subsets = Enumerable.Range(0, 1023).Select(x => (Card)x);
        int min = 11;
        foreach(var subset in subsets)
        {
            if(diffs.All(x => CanDistinguish(subset, x)))
            {
                // This is an answer
                min = Math.Min(min, CountBits((int)subset));
            }
        }

        return min;
    }

    static int CountBits(int num)
    {
        int res = 0;
        while(num > 0)
        {
            if ((num & 1) == 1) res++;
            num >>= 1;
        }
        return res;
    }

    static bool CanDistinguish(Card subset, Card diff)
    {
        return (subset & diff) != 0;
    }

    static Card Diff(Card f, Card s)
    {
        return f ^ s;
    }

    static Card ParseCard(string input)
    {
        Card colour = (Card)Enum.Parse(typeof(Card), input[0].ToString());
        Card num = Card.One;
        switch (input[1])
        {
            case '1': num = Card.One;break;
            case '2': num = Card.Two;break;
            case '3': num = Card.Three;break;
            case '4': num = Card.Four;break;
            case '5': num = Card.Five;break;
        }
        return colour | num;
    }
}


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

namespace CodeForces800
{
    internal static class Program
    {
        public static long prime = 1000000007;
        public static long[] bprime = new long[2];
        public static Dictionary<long, long> invar = new Dictionary<long, long>();
        public static long[] fact = new long[1];
        public static void Main()
        {
            var cur = prime - 2;
            var list = new List<long>();
            while (cur != 0)
            {
                list.Add(cur % 2);
                cur = cur / 2;
            }
            bprime = list.ToArray();
            var str = Console.ReadLine().Split(' ').Select(x => Int32.Parse(x)).ToList();
            var n = str[0];
            var k = str[1];
            long res = 0;
            fact = new long[n + 1];
            fact[0] = 1;
            for (var i = 1; i < n + 1; i++)
            {
                fact[i] = (long)((long)fact[i - 1] * i) % prime;
            }
            for (var i = 0; i <= Math.Min(n,k); i++)
            {
                res += C(n, i);
                res = res % prime;
            }
            Console.WriteLine(res);
        }
        private static long C(long n, long k)
        {
            if (n >= k)
            {
                long res = fact[n];
                res = res * calcInv(fact[n - k]);
                res = res % prime;
                res = res * calcInv(fact[k]);
                res = res % prime;
                return (long)res;
            }
            else return 0;
        }

        public static long calcInv(long n)
        {
            if (invar.TryGetValue(n, out var invn))
                return invn;
            else
            {
                var ost = new long[bprime.Length];
                ost[0] = n;
                for (var i = 1; i < bprime.Length; i++)
                {
                    ost[i] = (ost[i - 1] * ost[i - 1]) % prime;
                }
                long inv = 1;
                for (var i = 0; i < bprime.Length; i++)
                {
                    inv *= (bprime[i] == 1) ? ost[i] : 1;
                    inv = inv % prime;
                }
                invar.Add(n, (long)inv);

                return (long)inv;
            }
        }
    }
}


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

public class Program
{
    int N, K;
    BinomialCoefficient Binom;
    public void Solve()
    {
        var sc = new Scanner();
        N = sc.NextInt();
        K = sc.NextInt();

        // 2^n人 n回戦トーナメント

        // 優勝が小さい方が良い
        // トーナメントの構築、勝つ人決める

        // K回以下 結果変えられる

        // 可能な勝つ人最小

        if (K >= N)
        {
            Console.WriteLine(ModInt.Pow(2, N));
            return;
        }

        Binom = new BinomialCoefficient(N);
        ModInt ans = 0;
        for (int i = 0; i <= K; i++)
        {
            ans += Binom[N, i];
        }

        Console.WriteLine(ans);

        // 1 1 + N
        // 2 1 + N + 1 + 2 + 3 + ... (N-1)

        // 1 + 3 + (1 + 2)
    }

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

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

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

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

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

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

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

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

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

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

            return _line[_index++];
        }

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

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

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

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


using System;
using System.Linq;

namespace CSharp
{
    class _1060B
    {
        public static void Main()
        {
            long n = long.Parse(Console.ReadLine());
            long a = 0;

            while (a * 10 + 9 < n)
            {
                a = a * 10 + 9;
            }

            long b = n - a;
            Console.WriteLine(a.ToString().Sum(c => c - '0') + b.ToString().Sum(c => c - '0'));
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
namespace Codefoeces
{
    class Program
    {
        static void Main(string[] args)
        {

            long n = long.Parse(Console.ReadLine());
            long max = -1;
            long a1 = n / 2;

            long a = 0 ;
            long b = 0; ;
            int i = 1;

            if (n == 1)
            {
                Console.WriteLine(1);
                return;
            }
            while (i < 10 &&  n-b >= 0)
            {
                b = long.Parse(i +""+ new string('9', (int)Math.Log10(a1)) );
                a = n - b;
                if (a >= 0)
                {
                    if (a.ToString().Sum(c => c - '0') + b.ToString().Sum(c => c - '0') > max)
                    {
                        max = a.ToString().Sum(c => c - '0') + b.ToString().Sum(c => c - '0');
                    }
                }
                i++;
            }
            Console.WriteLine(max);

        }
    }
}


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

class Solver
{
	public void Solve()
	{
		var s = CF.ReadLine();
		int res = 0;
		foreach (var c in s)
		{
			res *= 16;
			switch (c)
			{
				case '>': res += 8;  break;
				case '<': res += 9; break;
				case '+': res += 10; break;
				case '-': res += 11; break;
				case '.': res += 12; break;
				case ',': res += 13; break;
				case '[': res += 14; break;
				case ']': res += 15; break;
			}
			res %= 1000003;
		}
		CF.WriteLine(res);
	}

	//  test
	static Utils CF = new Utils(new[]{
@"
,.
"
,
@"
++++[>,.<-]
"

    });
    #region test

    static void Main(string[] args)
    {
#if DEBUG
        for (int t=0;t<CF.TestCount;t++ )
        {
            CF.Test(t);
			var sw = new Stopwatch();
			sw.Start();
            new Solver().Solve();
			Debug.WriteLine("time: "+sw.ElapsedMilliseconds+ " ms");
		}
#else
        new Solver().Solve();
#endif
    }

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

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

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

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

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

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

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

        string[] _test_input;

        List<string> _lines;

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

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

    }

    #endregion
}


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

namespace Codeforces
{
    class A
    {
        private static bool s_time = false;

        static long mod = 1000003;

        private static object Go()
        {
            string s = GetString();

            Dictionary<char, int> map = new Dictionary<char, int>();
            map['>'] = 8;
            map['<'] = 9;
            map['+'] = 10;
            map['-'] = 11;
            map['.'] = 12;
            map[','] = 13;
            map['['] = 14;
            map[']'] = 15;

            long ret = 0;
            for (int i = 0; i < s.Length; i++)
            {
                ret = (ret * 16 + map[s[i]]) % mod;
            }

            return ret;
        }

        #region Template

        public static void Main(string[] args)
        {
            DateTime start = DateTime.Now;
            object output = Go();
            TimeSpan duration = DateTime.Now.Subtract(start);
            if (output != null)
                Wl<string>(output.ToString());
            if (s_time)
                Wl(duration);
        }

        private static IEnumerator<string> ioEnum;
        private static string GetString()
        {
            while (ioEnum == null || !ioEnum.MoveNext())
            {
                ioEnum = Console.ReadLine().Split().AsEnumerable().GetEnumerator();
            }

            return ioEnum.Current;
        }

        private static int GetInt()
        {
            return int.Parse(GetString());
        }

        private static long GetLong()
        {
            return long.Parse(GetString());
        }

        private static double GetDouble()
        {
            return double.Parse(GetString());
        }

        private static List<int> GetIntArr(int n)
        {
            List<int> ret = new List<int>(n);
            for (int i = 0; i < n; i++)
            {
                ret.Add(GetInt());
            }
            return ret;
        }

        private static void Wl<T>(T o)
        {
            Console.WriteLine(o.ToString());
        }

        private static void Wl<T>(IEnumerable<T> enumerable)
        {
            Wl(string.Join(" ", enumerable.Select(e => e.ToString()).ToArray()));
        }

        public struct Tuple<T, K> : IComparable<Tuple<T, K>>
            where T : IComparable<T>
            where K : IComparable<K>
        {
            public T Item1;
            public K Item2;

            public Tuple(T t, K k)
            {
                Item1 = t;
                Item2 = k;
            }

            public override bool Equals(object obj)
            {
                var o = (Tuple<T, K>)obj;
                return o.Item1.Equals(Item1) && o.Item2.Equals(Item2);
            }

            public override int GetHashCode()
            {
                return Item1.GetHashCode() ^ Item2.GetHashCode();
            }

            public override string ToString()
            {
                return "(" + Item1 + " " + Item2 + ")";
            }

            #region IComparable<Tuple<T,K>> Members

            public int CompareTo(Tuple<T, K> other)
            {
                int ret = Item1.CompareTo(other.Item1);
                if (ret != 0) return ret;
                return Item2.CompareTo(other.Item2);
            }

            #endregion
        }

        #endregion
    }
}


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

class Program
{
    private static void Main(string[] args)
    {
        var tmp = Console.ReadLine().Split(' ');
        var s = tmp[0];
        var k = int.Parse(tmp[1]);

        if (s.Count(ss => ss == '0') < k)
        {
            Console.Write(s.Length - 1);
            return;
        }

        int cnt = 0;
        int zeros = 0;
        for (int i = s.Length - 1; i > 0; i--)
        {
            if (s[i] != '0')
                cnt++;
            else
                zeros++;

            if (zeros == k)
            {
                Console.WriteLine(cnt);
                return;
            }
        }

        Console.Write(0);
    }

    private const int Mod = 1000000000 + 7;

    #region Data Read
    private static char ReadSign()
    {
        while (true)
        {
            int ans = consoleReader.Read();
            if (ans == '+' || ans == '-' || ans == '?')
                return (char)ans;
        }
    }

    private static long GCD(long a, long b)
    {
        if (a % b == 0) return b;
        return GCD(b, a % b);
    }

    private static List<int>[] ReadGraph(int n, int m)
    {
        List<int>[] g = new List<int>[n];
        for (int i = 0; i < g.Length; i++) g[i] = new List<int>();
        for (int i = 0; i < m; i++)
        {
            int a = RI() - 1;
            int b = RI() - 1;

            g[a].Add(b);
            g[b].Add(a);
        }

        return g;
    }

    private static int[,] ReadGraphAsMatrix(int n, int m)
    {
        int[,] matrix = new int[n + 1, n + 1];
        for (int i = 0; i < m; i++)
        {
            int a = RI();
            int b = RI();
            matrix[a, b] = matrix[b, a] = 1;
        }

        return matrix;
    }

    private static void Sort(ref int a, ref int b)
    {
        if (a > b) Swap(ref a, ref b);
    }

    private static void Swap(ref int a, ref int b)
    {
        int tmp = a;
        a = b;
        b = tmp;
    }

    private const int BufferSize = 1 << 16;
    private static StreamReader consoleReader;
    private static MemoryStream testData;

    private static int RI()
    {
        int ans = 0;
        int mul = 1;
        do
        {
            ans = consoleReader.Read();
            if (ans == -1)
                return 0;
            if (ans == '-') mul = -1;
        } while (ans < '0' || ans > '9');

        ans -= '0';
        while (true)
        {
            int chr = consoleReader.Read();
            if (chr < '0' || chr > '9')
                return ans * mul;
            ans = ans * 10 + chr - '0';
        }
    }

    private static ulong RUL()
    {
        ulong ans = 0;
        int chr;
        do
        {
            chr = consoleReader.Read();
            if (chr == -1)
                return 0;
        } while (chr < '0' || chr > '9');

        ans = (uint)(chr - '0');
        while (true)
        {
            chr = consoleReader.Read();
            if (chr < '0' || chr > '9')
                return ans;
            ans = ans * 10 + (uint)(chr - '0');
        }
    }

    private static long RL()
    {
        long ans = 0;
        int mul = 1;
        do
        {
            ans = consoleReader.Read();
            if (ans == -1)
                return 0;
            if (ans == '-') mul = -1;
        } while (ans < '0' || ans > '9');

        ans -= '0';
        while (true)
        {
            int chr = consoleReader.Read();
            if (chr < '0' || chr > '9')
                return ans * mul;
            ans = ans * 10 + chr - '0';
        }
    }

    private static int[] RIA(int n)
    {
        int[] ans = new int[n];
        for (int i = 0; i < n; i++)
            ans[i] = RI();
        return ans;
    }

    private static long[] RLA(int n)
    {
        long[] ans = new long[n];
        for (int i = 0; i < n; i++)
            ans[i] = RL();
        return ans;
    }

    private static char[] ReadWord()
    {
        int ans;

        do
        {
            ans = consoleReader.Read();
        } while (!((ans >= 'a' && ans <= 'z') || (ans >= 'A' && ans <= 'Z')));

        List<char> s = new List<char>();
        do
        {
            s.Add((char)ans);
            ans = consoleReader.Read();
        } while ((ans >= 'a' && ans <= 'z') || (ans >= 'A' && ans <= 'Z'));

        return s.ToArray();
    }

    private static char[] ReadString(int n)
    {
        int ans;

        do
        {
            ans = consoleReader.Read();
        } while (!((ans >= 'a' && ans <= 'z') || (ans >= 'A' && ans <= 'Z')));

        char[] s = new char[n];
        int pos = 0;
        do
        {
            s[pos++] = (char)ans;
            if (pos == n) break;
            ans = consoleReader.Read();
        } while ((ans >= 'a' && ans <= 'z') || (ans >= 'A' && ans <= 'Z'));

        return s;
    }

    private static char[] ReadStringLine()
    {
        int ans;

        do
        {
            ans = consoleReader.Read();
        } while (ans == 10 || ans == 13);

        List<char> s = new List<char>();

        do
        {
            s.Add((char)ans);
            ans = consoleReader.Read();
        } while (ans != 10 && ans != 13 && ans != -1);

        return s.ToArray();
    }

    private static char ReadLetter()
    {
        while (true)
        {
            int ans = consoleReader.Read();
            if ((ans >= 'a' && ans <= 'z') || (ans >= 'A' && ans <= 'Z'))
                return (char)ans;
        }
    }
    private static char ReadNonLetter()
    {
        while (true)
        {
            int ans = consoleReader.Read();
            if (!((ans >= 'a' && ans <= 'z') || (ans >= 'A' && ans <= 'Z')))
                return (char)ans;
        }
    }

    private static char ReadAnyOf(IEnumerable<char> allowed)
    {
        while (true)
        {
            char ans = (char)consoleReader.Read();
            if (allowed.Contains(ans))
                return ans;
        }
    }

    private static char ReadDigit()
    {
        while (true)
        {
            int ans = consoleReader.Read();
            if (ans >= '0' && ans <= '9')
                return (char)ans;
        }
    }

    private static int ReadDigitInt()
    {
        return ReadDigit() - (int)'0';
    }

    private static char ReadAnyChar()
    {
        return (char)consoleReader.Read();
    }

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

    private static double DoubleFromString(string x)
    {
        return double.Parse(x, CultureInfo.InvariantCulture);
    }

    static Program()
    {
        //Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
        consoleReader = new StreamReader(Console.OpenStandardInput(BufferSize), Encoding.ASCII, false, BufferSize);
    }

    private static void PushTestData(StringBuilder sb)
    {
        PushTestData(sb.ToString());
    }
    private static void PushTestData(string data)
    {
#if TOLYAN_TEST
        if (testData == null)
        {
            testData = new MemoryStream();
            consoleReader = new StreamReader(testData);
        }

        var pos = testData.Position;
        var bytes = Encoding.UTF8.GetBytes(data);
        testData.Write(bytes, 0, bytes.Length);
        testData.Flush();
        testData.Position = pos;
#endif
    }
    #endregion
}


using System;
class Program
    {
        public static void Main(string[] args)
        {
            string[] input = Console.In.ReadLine().Split(new char[] { ' ', '\n', '\r', '\t' }, StringSplitOptions.RemoveEmptyEntries);
            int a = int.Parse(input[1]);
            int deleted = 0;
            for(int i = input[0].Length-1; i>0 && a>0; --i)
            {
                if (input[0][i] == '0') a--;
                else deleted++;
            }
            if (a > 0) deleted = input[0].Length - 1;
            Console.WriteLine(deleted);
        }
    }


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

namespace contest
{

    class contest
    {

        static void Main(string[] args)
        {

            //int n = int.Parse(Console.ReadLine());
            //var input = Console.ReadLine().Split().Select(int.Parse).ToArray();

            //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();

            var num = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int a = num[0];
            int target = num[1];
            int dif = num[2];

            if (a == target) Console.WriteLine("YES");
            else if (dif == 0) Console.WriteLine("NO");
            else if (target > a && dif < 0) Console.WriteLine("NO");
            else if (target < a && dif > 0) Console.WriteLine("NO");
            else if ((target - a) % dif == 0) Console.WriteLine("YES");
            else Console.WriteLine("NO");

            //Console.WriteLine();

            //Console.Read();

        }

    }

}


using System;

namespace ConsoleApplication16
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');
            int[] n = Array.ConvertAll(s, int.Parse);

            if (n[2] == 0)
            {
                if (n[1] == n[0])
                {
                    Console.WriteLine("YES");
                }
                else
                {
                    Console.WriteLine("NO");
                }
            }

            else if ((n[1] < n[0] && n[2] > 0) || (n[1] > n[0] && n[2] < 0))
            {
                Console.WriteLine("NO");
            }
            else
            {
                if ((n[1] - n[0]) % n[2] == 0)
                {
                    Console.WriteLine("YES");
                }
                else
                {
                    Console.WriteLine("NO");
                }
            }
        }

    }

}


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

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

        public FastScanner(Stream stream) : base(stream)
        {
            _line = null;
            _iterator = 0;
        }
        public int NextInt()
        {
            if (_line == null || _iterator >= _line.Length)
            {
                _line = base.ReadLine().Split(' ');
                _iterator = 0;
            }
            if (_line.Count() == 0) throw new IndexOutOfRangeException("Input string is empty");
            return Convert.ToInt32(_line[_iterator++]);
        }
        public long NextLong()
        {
            if (_line == null || _iterator >= _line.Length)
            {
                _line = base.ReadLine().Split(' ');
                _iterator = 0;
            }
            if (_line.Count() == 0) throw new IndexOutOfRangeException("Input string is empty");
            return Convert.ToInt64(_line[_iterator++]);
        }
    }
    class IteratedLinearFunctionECR13
    {
        private static int _mod = (int)1e9 + 7;
        public static void Main(string[] args)
        {
            using (FastScanner fs = new FastScanner(new BufferedStream(Console.OpenStandardInput())))
            using (StreamWriter writer = new StreamWriter(new BufferedStream(Console.OpenStandardOutput())))
            {
                long A = fs.NextLong(), B = fs.NextLong(), n = fs.NextLong(), x = fs.NextLong();
                if (n == 0) writer.WriteLine(x);
                else if (n == 1) writer.WriteLine((A * x + B) % _mod);
                else
                {
                    long[,] initial = new long[,] { { A * x + B, 1 } };
                    long[,] factor = new long[,] { { A, 0 }, { B, 1 } };
                    long[,] res = MultiplyMatricesMod(initial, BinPowMatrixMod(factor, n - 1, _mod), _mod);
                    writer.WriteLine(res[0, 0]);
                }
            }
        }
        public static long BinPow(long a, long p)
        {
            if (p == 0) return 1;
            if ((p & 1) == 0)
            {
                long t = BinPow(a, p / 2);
                return t * t;
            }
            else
            {
                return a * BinPow(a, p - 1);
            }
        }
        public static long BinPowMod(long a, long p, long mod)
        {
            if (p == 0) return 1;
            if ((p & 1) == 0)
            {
                long t = BinPow(a, p / 2);
                return (t * t) % mod;
            }
            else
            {
                return (a % mod * BinPow(a, p - 1)) % mod;
            }
        }

        public static long[,] BinPowMatrix(long[,] a, long p) // p >= 1
        {
            if (a.GetLength(0) != a.GetLength(1))
            {
                throw new Exception("Not a square matrix");
            }

            if (p == 1) return a;
            if ((p & 1) == 0)
            {
                long[,] t = BinPowMatrix(a, p / 2);
                return MultiplyMatrices(t, t);
            }
            else
            {
                return MultiplyMatrices(a, BinPowMatrix(a, p - 1));
            }
        }

        public static long[,] BinPowMatrixMod(long[,] a, long p, long mod) // p >= 1
        {
            if (a.GetLength(0) != a.GetLength(1))
            {
                throw new Exception("Not a square matrix");
            }

            if (p == 1) return a;
            if ((p & 1) == 0)
            {
                long[,] t = BinPowMatrixMod(a, p / 2, mod);
                return MultiplyMatricesMod(t, t, mod);
            }
            else
            {
                return MultiplyMatricesMod(a, BinPowMatrixMod(a, p - 1, mod), mod);
            }
        }

        private static long[,] MultiplyMatrices(long[,] a, long[,] b)
        {
            if (a.GetLength(1) == b.GetLength(0))
            {
                long[,] c = new long[a.GetLength(0), b.GetLength(1)];
                for (int i = 0; i < c.GetLength(0); i++)
                {
                    for (int j = 0; j < c.GetLength(1); j++)
                    {
                        c[i, j] = 0;
                        for (int k = 0; k < a.GetLength(1); k++)
                            c[i, j] = c[i, j] + a[i, k] * b[k, j];
                    }
                }
                return c;
            }
            else
            {
                throw new Exception("Can't multiply because of incompatible sizes");
            }
        }

        private static long[,] MultiplyMatricesMod(long[,] a, long[,] b, long mod)
        {
            if (a.GetLength(1) == b.GetLength(0))
            {
                long[,] c = new long[a.GetLength(0), b.GetLength(1)];
                for (int i = 0; i < c.GetLength(0); i++)
                {
                    for (int j = 0; j < c.GetLength(1); j++)
                    {
                        c[i, j] = 0;
                        for (int k = 0; k < a.GetLength(1); k++)
                        {
                            c[i, j] = c[i, j] + a[i, k] % mod * b[k, j] % mod;
                            c[i, j] %= mod;
                        }
                    }
                }
                return c;
            }
            else
            {
                throw new Exception("Can't multiply because of incompatible sizes");
            }
        }

        private static long[,] MatrixMod(long[,] a, long mod)
        {
            long[,] b = new long[a.GetLength(0), a.GetLength(1)];
            for (int i = 0; i < a.GetLength(0); i++)
            {
                for (int j = 0; j < a.GetLength(1); j++)
                {
                    b[i, j] = a[i, j] % mod;
                }
            }
            return b;
        }
    }
}