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

namespace zadacha2
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.ReadLine();
            string a=Console.ReadLine();
            int n = a.Length;
                        int N = 0;
            for (int i=0;i<n;i++)
            {
                char c = a[i];

                if (a[i]==char.ToUpper(c))
                {
                    N++;
                }

            }
            int[] verh = new int[N];
            int nom = 0;
            for (int i = 0; i < n; i++)
            {
                char c = a[i];

                if (a[i] == char.ToUpper(c))
                {
                    verh[nom] = i;
                    nom++;
                }

            }

            string[] str = new string[N+1];
            int k = 0;
            if(N==1)
            {
                int razm = verh[0];
                int m = 0;
                char[] temp = new char[razm];
                for (int j = 0; j < razm; j++)
                {
                    temp[m] = a[j];
                    m++;
                }
                str[k] = new string(temp);
                k++;
                m = 0;
                razm = n - verh[0]-1;
                char[] temp3 = new char[razm];
                for (int j = verh[0]+1; j < n; j++)
                {
                    temp3[m] = a[j];
                    m++;
                }
                str[k] = new string(temp3);

            }
            for (int i = 0; i < N - 1; i++)
            {

                if ((verh[i] > 0) && (verh[i] < n) && (i == 0))
                {
                    int razm = verh[0];
                    int m = 0;
                    char[] temp = new char[razm];
                    for (int j = 0; j < razm; j++)
                    {
                        temp[m] = a[j];
                        m++;
                    }
                    str[k] = new string(temp);
                    k++;
                }

                if ((verh[i] > 0) && (verh[i] < n) && (verh[i + 1] - verh[i] > 0))
                {
                    int razm = verh[i + 1] - verh[i] - 1;
                    int m = 0;
                    char[] temp = new char[razm];
                    for (int j = verh[i] + 1; j < verh[i + 1]; j++)
                    {
                        temp[m] = a[j];
                        m++;
                    }
                    str[k] = new string(temp);
                    k++;
                }
            }

            int m1 = 0;
            int raz = n - verh[N-1] - 1;
            char[] temp2 = new char[raz];
            for (int j = verh[N-1] + 1; j < n; j++)
            {
                temp2[m1] = a[j];
                m1++;
            }
            str[k] = new string(temp2);

            int max = 0;
            for (int i=0;i<str.Length;i++)
            {
                if(str[i]!=null&&str[i]!="")
                {
                    string st = str[i];
                    st = new string(st.Distinct().ToArray());
                    if (st.Length>max)
                    {
                        max = st.Length;
                    }

                }
            }
            Console.WriteLine(max);
           // Console.ReadLine();

        }
    }
}


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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            const Int64 mod = 1000000007;
            string[] t = Console.ReadLine().Split(
                new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
            int n = int.Parse(t[0]);
            int m = int.Parse(t[1]);
            int k = int.Parse(t[2]);
            if (n == k)
            {
                Int64 res = 1;
                for (int i = 0; i < n / 2 + n % 2; i++)
                    res = (res * m) % mod;
                Console.WriteLine(res);
                return;
            }
            if (k > n)
            {
                Console.Write("0");
                return;
            }
            if (k == 1)
            {
                Int64 res = 1;
                for (int i = 0; i < n; i++)
                    res = (res * m) % mod;
                Console.WriteLine(res);
                return;
            }
            if (k % 2 == 0)
            {
                Console.WriteLine(m);
                return;
            }
            Console.WriteLine(m * m);
        }
    }
}


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

namespace round516
{
  class MainClass
  {
    public static void Main(string[] args)
    {
#if DEBUG
      //var line = Array.ConvertAll("4 1 4 12".Split(' '), int.Parse);
      //var line = Array.ConvertAll("31 12 6 81".Split(' '), int.Parse);
      //var line = Array.ConvertAll("10 5 5 1".Split(' '), int.Parse);
#else
      var line = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
#endif
      var n = line[0];
      var l = line[1];
      var r = line[2];
      var k = line[3];

      if (l > r)
        r = n - l + r + 1;
      else
        r = r - l + 1;
      l = 1;
      var b = n - r;

      int result = -1;

      for (int extra = 0; extra <= n; ++extra)
      {
        int full = n + extra;
        int b_extra = n - r;
        if (extra > b_extra)
        {
          int a_extra = extra - b_extra;
          int mod = (k - r - a_extra) % full;
          if (mod == 0 || mod == full - 1 || mod == -1)
            result = Math.Max(result, extra);
        }
        else
        {
          int mod = (k - r) % full;
          if (mod == 0)
            result = Math.Max(result, extra);
        }
      }

      Console.WriteLine(result);
    }
  }
}


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

namespace round516
{
  class MainClass
  {
    static long solve(long n, long a, long b, long k, long p)
    {
      long result = -1;
      if (n <= 1000000)
      {
        for (long a_extra = p; a_extra <= a; ++a_extra)
          for (long b_extra = 0; b_extra <= b; ++b_extra)
            if ((k - a - a_extra) % (n + a_extra + b_extra) == 0)
              result = Math.Max(result, a_extra + b_extra);
      }
      return result;
    }

    public static void Main(string[] args)
    {
#if DEBUG
      //var line = Array.ConvertAll("4 1 4 12".Split(' '), long.Parse);
      //var line = Array.ConvertAll("31 12 6 81".Split(' '), long.Parse);
      //var line = Array.ConvertAll("100000000 76041209 26041209 700400000".Split(' '), long.Parse);
      //var line = Array.ConvertAll("4938239193 4924044987 1597580621 63742933607".Split(' '), long.Parse);
      //var line = Array.ConvertAll("200 185 44 28099".Split(' '), long.Parse);
      //var line = Array.ConvertAll("100000000 41790937 91790936 253001999".Split(' '), long.Parse);
      //var line = Array.ConvertAll("10 5 5 1".Split(' '), long.Parse);
      var line = Array.ConvertAll("5 4 5 6".Split(' '), long.Parse);
      //var line = Array.ConvertAll("2 1 2 91167168968".Split(' '), long.Parse);
      //var line = Array.ConvertAll("10 2 3 64603826899".Split(' '), long.Parse);
      //var line = Array.ConvertAll("100000000000 54542941105 63449647466 13221518898".Split(' '), long.Parse);
      //var line = Array.ConvertAll("10 1 10 17".Split(' '), long.Parse);
      //var line = Array.ConvertAll("2 1 2 91167168968".Split(' '), long.Parse);
      //var line = Array.ConvertAll("1000 811 818 88621462639".Split(' '), long.Parse);
#else
      var line = Array.ConvertAll(Console.ReadLine().Split(' '), long.Parse);
#endif
      var n = line[0];
      var l = line[1];
      var r = line[2];
      var k = line[3];

      if (l > r)
        r = n - l + r + 1;
      else
        r = r - l + 1;
      l = 1;
      var b = n - r;

      long result = -1;

      if (k <= n || k <= r * 2)
      {
        if (r <= k && k <= r * 2)
        {
          long a_extra = k - r;
          result = Math.Min(b + a_extra + 1, n);
        }
      }
      else if (n <= 1000000)
      { // by sweet tooth
        result = Math.Max(solve(n, r, b, k, 0), solve(n, r, b, k + 1, 1));
      }
      else
      { // by round
        long max_round = k / n;
        for (long round = max_round / 2; round <= max_round; ++round)
        {
          long extra_round_a = k - n * round - r; // extra * round + a_extra -> b_extra * round + a_extra * (round + 1)
          long round1 = round + 1;
          if (extra_round_a > n * round + r) continue;

          if (extra_round_a >= b * round)
          {
            for (long b_extra = b; b_extra >= 0; --b_extra)
            {
              long mod = (extra_round_a - b_extra * round + round1) % round1;
              if (mod == 0 || mod == 1)
              {
                long a_extra = (extra_round_a + mod - b_extra * round) / round1;
                if (a_extra > r) continue;
                result = Math.Max(result, a_extra + b_extra);
                break;
              }
            }
          }
          else
          {
            long b_extra = extra_round_a / round;
            long mod = (extra_round_a - b_extra * round + round1) % round1;
            if (mod == 0 || mod == 1)
            {
              long a_extra = (extra_round_a + mod - b_extra * round) / round1;
              if (a_extra > r) continue;
              result = Math.Max(result, a_extra + b_extra);
            }
          }
        }
      }

      Console.WriteLine(result);
    }
  }
}


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

namespace Ejercicios
{
    class Program
    {
        static string funcion (string str)
        {
            string newStr = "", first;

            if (str.Length == 1 && isLower(str[0]))
                return str.ToUpper();

            if (str.Length == 1 && isUpper(str[0]))
                return str.ToLower;

            if (isUpper(str[0])){
                if (rest(str))
                    return str.ToLower();
                else
                    return str;
            }
            else
            {
                if (rest(str))
                {
                    first = str[0].ToString().ToUpper();
                    newStr = str.Substring(1);
                    newStr = first + newStr.ToLower();
                    return newStr;
                }
                else
                {
                    return str;
                }

            }
        }

        static bool rest (string str){
            for (int i = 1; i < str.Length; i++)
            {
                if (isLower(str[i]))
                    return false;
            }
            return true;
        }

        static bool isUpper(char letter)
        {
            string alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
            for (int i = 0; i < alpha.Length; i++)
            {
                if (letter == alpha[i])
                return true;
            }
            return false;
        }

        static bool isLower(char letter)
        {
            string alpha = "abcdefghijklmnopqrstuvwxyz";
            for (int i = 0; i < alpha.Length; i++)
            {
                if (letter == alpha[i])
                    return true;
            }
            return false;
        }

        static void Main(string[] args)
        {
            string str = Console.ReadLine();
            Console.WriteLine(funcion(str));
        }
    }
}


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

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

				//Console.ReadKey();
			}
		}
	}

	internal class Task
	{
		public void Solve(InputReader sr, TextWriter sw)
		{
			var input = sr.ReadArray(Int32.Parse);
			var m = input[0];
			var d = input[1];
			var totalDays = m % 2 == 1 ? 31 : 30;
			if (m == 2) {
				totalDays = 28;
			}
			var cols = 1;
			var dayOfWeek = d;
			while (totalDays > 0) {
				dayOfWeek++;
				if (dayOfWeek > 7) {
					dayOfWeek = 1;
					cols++;
				}
				totalDays--;
			}

			sw.WriteLine(cols);
		}
	}
}

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

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

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

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

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

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

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

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

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

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

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


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

namespace ConsoleApplication5
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');
            int T = Convert.ToInt32(s[0]);
            int S = Convert.ToInt32(s[1]);
            int q = Convert.ToInt32(s[2]);
            int k = 1;
            while (q * S < T)
            {
                k++;
                q = q * S;

            }
            Console.WriteLine(k);
        }
    }
}


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

namespace Vanya_and_Cards
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');
            int n = Int32.Parse(s[0]);
            int x = Int32.Parse(s[1]);
            int[] a = Array.ConvertAll(Console.ReadLine().Split(' '), Int32.Parse);
            int sum = a.Sum();
            if (sum != 0)
            {
                int req = Math.Abs(sum) / x + (Math.Abs(sum) % x == 0 ? 0 : 1);
                Console.WriteLine(req);
            }
            else
                Console.WriteLine(0);
            Console.ReadLine();
        }
    }
}


using System;
using System.Collections.Generic;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            Queue<int> queue = new Queue<int>();
            int n = int.Parse(Console.ReadLine());
            for (int i = 0; i < n; i++)
            {
                queue.Enqueue(int.Parse(Console.ReadLine()));
            }
            for (int i = 0; i < n; i++)
            {
                Console.WriteLine(prov(queue.Dequeue()));
            }
        }
        static string prov(int input)
        {
            if (((input % 7) % 3) == 0)
                return "YES";
            return "NO";
        }
    }
}


using System;

namespace ConsoleApplication
{
    class Program
    {
        static void Main(string[] args)
        {
            ushort n = ushort.Parse(Console.ReadLine());
            ushort small = 3;
            ushort big = 7;
            ushort left = 0;
            bool found = false;

            for (ushort i = 0; i < 100; i++)
            {
                ushort x = ushort.Parse(Console.ReadLine());

                if (x % small == 0 || x % big == 0)
                {
                    Console.WriteLine("YES");
                    continue;
                }

                if (x % small % big == 0)
                {
                    Console.WriteLine("YES");
                    continue;
                }

                if (x % big % small == 0)
                {
                    Console.WriteLine("YES");
                    continue;
                }

                left = (ushort)(x % small);

                for (;left < x;)
                {
                    left = (ushort)(left + small);

                    if (left % big == 0)
                    {
                        Console.WriteLine("YES");
                        found = true;
                        break;
                    }
                }

                if(!found) Console.WriteLine("NO");
            }
        }
    }
}


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

namespace MakeCalendar
{
    class MainClass
    {

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

        static void ReadInt(ref int a)
        {
            a = ReadIntArrayLine()[0];
        }

        static void ReadInts(ref int a, ref int b)
        {
            var x = ReadIntArrayLine();
            a = x[0]; b = x[1];
        }

        static void ReadInts(ref int a, ref int b, ref int c)
        {
            var x = ReadIntArrayLine();
            a = x[0]; b = x[1]; c = x[2];
        }

        static void ReadInts(ref int a, ref int b, ref int c, ref int d)
        {
            var x = ReadIntArrayLine();
            a = x[0]; b = x[1]; c = x[2]; d = x[3];
        }

        static int[] ReadIntArrayLine()
        {
            char[] sep = { ' ' };
            return Console.ReadLine().Split(sep, StringSplitOptions.RemoveEmptyEntries).Select(x => int.Parse(x)).ToArray();
        }

        static void PrintLn(object obj)
        {
            Console.WriteLine(obj.ToString());
        }

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

//----------------------------------------------------------------------------

        static decimal findrem(decimal n, int p)
        {
            if (n == 0)
                return 1;
            if (n % 2 == 0)
                return (findrem(n / 2, p) * findrem(n / 2, p)) % p;
            n--;
            return (findrem(n / 2, p) * findrem(n / 2, p)*2) % p;
        }

        static void Main(string[] args)
        {
            decimal n = Convert.ToDecimal(Console.ReadLine());

            if (n == 0)
            { PrintLn(1); return; }

            int p = 1000000007;

            PrintLn((findrem(n-1,p)*(findrem(n,p)+1))%p);

        }

    }
}


//Rextester.Program.Main is the entry point for your code. Don't change it.
//Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5

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

namespace Rextester
{
    public class Program
    {
        public static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            int n = Convert.toInt32(s[0]);
            int m = Convert.toInt32(s[1]);
            int k = Convert.toInt32(s[2]);
            if (n <= m && n <= k)
                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[]y=Console.ReadLine().Split(' ');
             int n=int.Parse(y[0]);
             int m=int.Parse(y[1]);
             int k=int.Parse(y[2]);
             if(m>=n&&k>=n)
             Console.WriteLine("Yes");
             else
             Cosnole.WriteLine("No");
        }
    }
}


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

namespace ProblemSolving
{
    class Program
    {
       static bool IsPrime (int x)
        {
            bool flag = false;
            int y = 0;
            y = x / 2;
            for (int i = 2; i <= y; i++ )
            {
                if ( x % i == 0)
                {
                    flag = false;
                    break;
                }
                else
                {
                    flag = true;
                }
            }
            return flag;
        }
    }
      static void Main(string[] args)
        {

            int n = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int temp = 0;
            for (int i =  n+1 ; i <= m ; i++)
            {
                IsPrime(i);
                temp = i;
            }
            if (temp == m)
            {
                Console.WriteLine("YES");

            }
            else
            {
                Console.WriteLine("NO");
            }

        }

}


using System;
using System.IO;

namespace R_A
{
    class Program
    {
        static void Main(string[] args)
        {
            StreamReader f1 = new StreamReader("input.txt");
            StreamWriter f2 = new StreamWriter("output.txt");
            int[] a = new int[4];
            string[] s = new string[4];
            int k = 5;
            bool b;
            for (int i = 0; i < 4; i++)
            {
                s[i] = f1.ReadLine();
                a[i] = s[i].Length - 2;
            }
            int a1, a2;
            for (int i = 0; i < 4; i++)
            {
                b = true;
                for (int j = 0; j < 4; j++)
                {
                    if (a[i] > a[j])
                    {
                        a1 = a[i];
                        a2 = a[j];
                    }
                    else
                    {
                        a1 = a[j];
                        a2 = a[i];
                    }
                    if (((a1 / a2) < 2) && (i != j))
                    {
                        b = false;
                        break;
                    }
                }
                if (b) k = i;
            }
            if (k == 5) f2.WriteLine("C");
            else
            {
                f2.WriteLine(s[k].Substring(0, 1));
            }
            f1.Close();
            f2.Close();
        }
    }
}


using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
public class Codeforces
{
    protected static TextReader reader;
    protected static TextWriter writer;
    static void Main()
    {
        reader = new StreamReader(Console.OpenStandardInput(1024 * 10), System.Text.Encoding.ASCII, false, 1024 * 10);
        writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), System.Text.Encoding.ASCII, 1024 * 10);
        var l = new int[4];
        for (var i = 0; i < 4; i++)
        {
            l[i] = ReadToken().Skip(2).ToArray().Length;
        }
        var ll = Enumerable.Range(0, 4).ToArray();
        Array.Sort(l, ll);
        var great = 0;
        var choice = new Tuple<int, int>[6];
        var ind = 0;
        for (int i = 0; i < 3; i++)
        {
            for (int j = i + 1; j < 4; j++)
            {
                if (l[i] <= l[j] / 2)
                {
                    great++;
                    choice[ind++] = Tuple.Create(i, j);
                }
            }
        }
        if (great == 3)
        {
            if (choice.All(d => d.Item1 == 0))
            {
                Write((char)(ll[0] + 'A'));
            }
            else
            {
                Write((char)(ll[3] + 'A'));
            }
        }
        else
        {
            Write("C");
        }
        reader.Close();
        writer.Close();
    }
    #region Read / Write

    private static Queue<string> currentLineTokens = new Queue<string>();

    private static string[] ReadAndSplitLine()
    {
        return reader.ReadLine().Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
    }

    public static string ReadToken()
    {
        while (currentLineTokens.Count == 0)
            currentLineTokens = new Queue<string>(ReadAndSplitLine());
        return currentLineTokens.Dequeue();
    }

    public static int ReadInt()
    {
        return int.Parse(ReadToken());
    }

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

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

    public static int[] ReadIntArray()
    {
        return ReadAndSplitLine().Select(int.Parse).ToArray();
    }

    public static long[] ReadLongArray()
    {
        return ReadAndSplitLine().Select(long.Parse).ToArray();
    }

    public static double[] ReadDoubleArray()
    {
        return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();
    }
    public static int[][] ReadIntMatrix(int numberOfRows)
    {
        int[][] matrix = new int[numberOfRows][];
        for (int i = 0; i < numberOfRows; i++)
            matrix[i] = ReadIntArray();
        return matrix;
    }
    public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)
    {
        int[][] matrix = ReadIntMatrix(numberOfRows);
        int[][] ret = new int[matrix[0].Length][];
        for (int i = 0; i < ret.Length; i++)
        {
            ret[i] = new int[numberOfRows];
            for (int j = 0; j < numberOfRows; j++)
                ret[i][j] = matrix[j][i];
        }
        return ret;
    }

    public static string[] ReadLines(int quantity)
    {
        string[] lines = new string[quantity];
        for (int i = 0; i < quantity; i++)
            lines[i] = reader.ReadLine().Trim();
        return lines;
    }
    public static void WriteArray<T>(IEnumerable<T> array)
    {
        writer.WriteLine(string.Join(" ", array));
    }

    public static void Write<T>(params T[] array)
    {
        WriteArray(array);
    }

    public static void WriteLines<T>(IEnumerable<T> array)
    {
        foreach (var a in array)
            writer.WriteLine(a);
    }
    private static int Next()
    {
        int c;
        int res = 0;
        do
        {
            c = reader.Read();
            if (c == -1)
                return res;
        } while (c != '-' && (c < '0' || c > '9'));
        int sign = 1;
        if (c == '-')
        {
            sign = -1;
            c = reader.Read();
        }
        res = c - '0';
        while (true)
        {
            c = reader.Read();
            if (c < '0' || c > '9')
                return res * sign;
            res *= 10;
            res += c - '0';
        }
    }
    #endregion
}


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

namespace TestConsole
{

    class Program
    {

        public static void Main(string[] args)
        {
            int[] input = readIntArray(System.Console.ReadLine().Split(' '));
            int a = input[0];
            int b = input[1];
            int k = input[2];

            bool[] seive = new bool[b + 1];
            for (int i = 2; i < b + 1; i++)
            {
                seive[i] = true;
            }

            for (int i = 2; i < b + 1; i++)
            {
                if (seive[i])
                {
                    if (((long)i) * i < b + 1)
                    {
                        for (int j = i * i; j < b + 1; j += i)
                        {
                            seive[j] = false;
                        }
                    }
                }
            }

            int result = -1;

            int left = k;
            int right = b - a + 2;

            while (left != right)
            {
                int l = (right + left) / 2;
                bool forAllX = true;
                for (int x = a; x <= b - l + 1; x++)
                {
                    int primes = 0;
                    for (int i = x; i <= x + l - 1; i++)
                    {
                        if (seive[i]) primes++;
                    }
                    if (primes < k)
                    {
                        forAllX = false;
                        break;
                    }
                }
                if (forAllX)
                {
                    result = l;
                    right = l;
                }
                else
                {
                    left = l + 1;
                }
            }
            Console.WriteLine(result);
        }

        static int[] readIntArray(string[] inArray)
        {
            return inArray.Select(i => Int32.Parse(i)).ToArray();
        }

    }

}


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

namespace TestConsole
{

    class Program
    {

        public static void Main(string[] args)
        {
            int[] input = readIntArray(System.Console.ReadLine().Split(' '));
            int a = input[0];
            int b = input[1];
            int k = input[2];

            bool[] seive = new bool[b + 1];
            for (int i = 2; i < b + 1; i++)
            {
                seive[i] = true;
            }

            for (int i = 2; i < b + 1; i++)
            {
                if (seive[i])
                {
                    if (((long)i) * i < b + 1)
                    {
                        for (int j = i * i; j < b + 1; j += i)
                        {
                            seive[j] = false;
                        }
                    }
                }
            }

            int result = -1;

            int left = k;
            int right = b - a + 2;

            while (left != right)
            {
                int l = (right + left) / 2;

                int firstWindow = 0;
                for (int i = a; i <= a + l - 1; i++)
                {
                    if (seive[i]) firstWindow++;
                }

                bool forAllX = firstWindow >= k;

                if (forAllX)
                {
                    for (int x = a + 1; x <= b - l + 1; x++)
                    {
                        if (seive[x - 1]) firstWindow--;
                        if (seive[x + l - 1]) firstWindow++;
                        if (firstWindow < k)
                        {
                            forAllX = false;
                            break;
                        }
                    }
                }
                if (forAllX)
                {
                    result = l;
                    right = l;
                }
                else
                {
                    left = l + 1;
                }
            }
            Console.WriteLine(result);
        }

        static int[] readIntArray(string[] inArray)
        {
            return inArray.Select(i => Int32.Parse(i)).ToArray();
        }

    }

}


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

namespace Rextester
{
    public class Program
    {
        public static void Main(string[] args)
        {
            int numeroSorte= int.Parse(Console.ReadLine());  // receber valor
        		  	ForcaBrruta(numeroSorte);
            //Console.ReadKey();
        }
        static void ForcaBrruta(int numSorte)
		{
		int indice =0;
		int [ ] Vetor = new int [100];
		int resultado = 0;

			for( int i =0; i <= numSorte; i++)
			{
				if(NumeroSort(Convert.ToString(i)))
				{
					Vetor[indice] = i;
					if(Vetor[indice] == numSorte)
					{
						resultado = indice;
					}
					indice++;
				}
			}
			Console.WriteLine(resultado+1);
		}
        static bool NumeroSort(string x)
		{
			for(int i = 0; i < x.Length; i++)
			{
				if(x[i] != '4' && x[i] != '7')
					return(false);
			}
			return (true);
		}
    }
}


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

namespace Rextester
{
    public class Program
    {
        public static void Main(string[] args)
        {
            int numeroSorte= int.Parse(Console.ReadLine());  // receber valor
        		  	ForcaBrruta(numeroSorte);
            //Console.ReadKey();
        }
        static void ForcaBrruta(int numSorte)
		{
		int indice =0;
		int [ ] Vetor = new int [99999999];
		int resultado = 0;

			for( int i =0; i <= numSorte; i++)
			{
				if(NumeroSort(Convert.ToString(i)))
				{
					Vetor[indice] = i;
					if(Vetor[indice] == numSorte)
					{
						resultado = indice;
					}
					indice++;
				}
			}
			Console.WriteLine(resultado+1);
		}
        static bool NumeroSort(string x)
		{
			for(int i = 0; i < x.Length; i++)
			{
				if(x[i] != '4' && x[i] != '7')
					return(false);
			}
			return (true);
		}
    }
}


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

namespace Cod
{
    class Program
    {
        static void Main(string[] args)
        {
            var nB = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            var data = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            var previousEven = data[0] % 2 == 0;
            // Первая часть до следующего разделителя
            var firstPart = true;
            var first = 1;
            var difs = new List<int>();
            for (int i = 1; i < nB[0]; i++)
            {
                var currentEven = data[i] % 2 == 0;
                if (currentEven == previousEven)
                {
                    first++;
                }
                else
                {
                    // Это закончилась первая часть?
                    if (firstPart)
                    {
                        firstPart = false;
                    }
                    first--;
                    // Если закончилась вторая часть...
                    if (first == 0 && i != nB[0] - 1)
                    {
                        // то ставим разделитель (если не конец).
                        difs.Add(Math.Abs(data[i] - data[i+1]));
                        firstPart = true;
                    }
                }
            }
            var prices = difs.OrderBy(m=>m).ToArray();
            var sum = 0;
            var number = 0;
            foreach (var price in prices)
            {
                if (sum + price <= nB[1])
                {
                    sum += price;
                    number++;
                }
                else
                {
                    break;
                }
            }
            Console.WriteLine(number);
            //Console.ReadKey();
        }
    }
}


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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            var ha = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
            var hb = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse).ToList();
            var sum = 0;
            var totalbit = 0;
            if (ha[0] % 2 == 1)
            {
                Console.Write(sum);
                return;
            }
            for (int i = 1; i < ha[0]; i += 2)
            {
                if (i == ha[0] - 1) break;
                var listleft= hb.Take(i + 1).ToList();
                var listright = hb.Skip(i+1).ToList();
                if ((listleft.Count(a => a % 2 == 0) != listleft.Count(a => a % 2 != 0)) && (listright.Count(a => a % 2 == 0) != listright.Count(a => a % 2 != 0))) continue;
                if (Math.Abs(hb[i] - hb[i + 1]) + totalbit <= ha[1])
                {
                    totalbit = totalbit + Math.Abs(hb[i] - hb[i + 1]);
                    sum += 1;
                }
            }

            Console.Write(sum);
        }
    }
}


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

namespace Task
{
    class Program
    {
        public static int[] b;
        public static int[] ans;
        public static int[] cnt = new int[10];

        static void Main(string[] args)
        {
            // Console.WriteLine((int)Math.Ceiling((double)10 / 3));
            // return;

            string str = Console.ReadLine();
            ans = new int[str.Length];
            foreach(char ch in str)
            {
                cnt[int.Parse(ch + "")]++;
            }

            str = Console.ReadLine();
            b = new int[str.Length];
            for (int i = 0; i < str.Length; i++)
            {
                b[i] = int.Parse(str[i] + "");
            }

            Rec(0, ans.Length == b.Length ? 1 : 2);
            for (int i = 0; i < ans.Length; i++)
                Console.Write(ans[i]);
            Console.WriteLine();
        }

        public static bool Rec(int pos, int stat/*1 или 2*/)
        {
            if (stat == 2)
            {
                for (int i = 9; i >= 0; i--)
                {
                    while(cnt[i] > 0)
                    {
                        ans[pos++] = i;
                        cnt[i]--;
                    }
                }
                return true;
            } else
            {
                if (cnt[b[pos]] > 0)
                {
                    cnt[b[pos]]--;
                    ans[pos] = b[pos];
                    bool res = Rec(pos + 1, stat);
                    if (res) return true;
                    cnt[b[pos]]++;
                }

                for (int i = b[pos] - 1; i >= 0; i--)
                {
                    if (cnt[i] <= 0) continue;
                    ans[pos] = i;
                    cnt[i]--;
                    return Rec(pos + 1, 2);
                }
                return false;
            }
        }
    }
}


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

namespace ConsoleApplication16
{
    class Program
    {
        static void Main(string[] args)
        {
            String word = Console.ReadLine();

            while(word.StartsWith("WUB")) word.Substring(3);
            while (word.EndsWith("WUB")) word.Substring(0, word.Length - 3);

            Console.WriteLine(String.Join(" ", word.Split(new[] { "WUB" }, StringSplitOptions.RemoveEmptyEntries)));
                Console.ReadLine();
        }
    }
}


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

namespace CavePainting
{
    class Program
    {
        static void Main(string[] args)
        {
            var ints = Console.ReadLine().Split().Select(int.Parse);
            int n = ints.ElementAt(0), k = ints.ElementAt(1);

            List<int> leftOvers = new List<int>();
            int tmp;
            int i = 1;

            for ( ;i <= k; i++)
            {
                tmp = n % i;

                if (!leftOvers.Contains(tmp)) leftOvers.Add(tmp);
                else break;
            }

            if (i == k+1) Console.WriteLine("Yes");
            else Console.WriteLine("No");

        }
    }
}


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

class Program {
  static void Main(string[] args) {
    int tt = int.Parse(Console.ReadLine());
    for (int qq = 1; qq <= tt; qq++) {
      int n = int.Parse(Console.ReadLine());
      int[] a = Console.ReadLine().Split().Select(token => int.Parse(token)).ToArray();
      int sum = 0;
      for (int i = 0; i < n; i++) {
        sum += a[i];
      }
      Console.WriteLine("Caso #{0}: {1}", qq, sum);
    }
  }
}


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

namespace B.Медвежонок_и_поиск_преступников
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] buffer = Console.ReadLine().Split(' ');
            int allTown = int.Parse(buffer[0]);
            int CurrentTown = int.Parse(buffer[1]);
            CurrentTown--;
            buffer = Console.ReadLine().Split(' ');
            int[] towns = new int[buffer.Length];
            for (int i = 0; i < buffer.Length; i++)
            {
                towns[i] = int.Parse(buffer[i]);
            }
            int summ = 0;
            if (towns[CurrentTown] == 1)
            {
                summ++;
            }
            int radius = 0;
            radius = Math.Min(CurrentTown, towns.Length - CurrentTown);
            for (int i = 1; i <= radius; i++)
            {
                if ((towns[CurrentTown - i] == towns[CurrentTown + i]) && (towns[CurrentTown - i] == 1))
                {
                    summ += 2;
                }
            }
            for (int i = 0; i < CurrentTown-radius; i++)
            {
                if (towns[i] == 1)
                {
                    summ++;
                }
            }
            for (int i = CurrentTown + radius + 1; i < towns.Length; i++)
            {
                if (towns[i] == 1)
                {
                    summ++;
                }
            }
            Console.WriteLine(summ);
        }
    }
}


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

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

            int[] arr = Console.ReadLine().Split().Select(E => int.Parse(E)).ToArray();
            int P = arr[1];
            int p = P - 1;
            int c = arr[0];
            int f = 0;
            int l = c - 1;
            int z = 0;
            string s=Console.ReadLine();
            s=s.Replace(" ", "");
            char[] cities = s.ToCharArray();
            int p_i=p-1;
            int p__i=p+1;
            if (cities[p] == '1')
            {
                z++;
            }
            while (true)
            {
                if ( p_i >= 0 && p__i <= l)
                {
                    if (cities[ p_i] == '1' &&cities[ p__i] == '1')
                    {
                        z += 2;

                    }
                    p__i++;
                    p_i--;
                }
                else if (p_i >= 0 && p__i > l)
                {
                    if (cities[ p_i] == '1')
                    {
                        z++;
                        p__i++;
                        p_i--;
                    }
                }
                else if (p_i < 0 && p__i <= l)
                {
                    if (cities[p__i] == '1')
                    { z++; }

                    p__i++;
                    p_i--;
                }
                else { break; }

            }
            Console.WriteLine(z);

        }
    }
}


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

namespace CF_Bear_and_Finding_Criminals
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();
            int NumberOfCities = int.Parse(input[0].ToString()) - 1  ;
            int OfficerPosition = int.Parse(input[2].ToString()) - 1 ;
            int count = 0 ;
            int condition;
           string Cities  = Console.ReadLine() ;
           Cities = RemoveSpaces(Cities, ' ');

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

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

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

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

        }
    }
}


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

namespace Practice
{
    class Program
    {
        static void Main(string[] args)
        {
            int [] inputs = GetInts();
            int[] criminals = GetInts();
            Console.WriteLine(SolveProblem(inputs, criminals));
            Console.ReadLine();

        }

        static int SolveProblem(int [] inputs, int [] criminals)
        {
            int noOfCriminals = 0;
            int i = inputs[1] - 1;
            int j = inputs[1] - 1;

            while (i < criminals.Length && j >= 0)
            {
                if (criminals [i] == criminals [j] && i != j && criminals [i] > 0)
                {
                    noOfCriminals = noOfCriminals + 2;
                } else if (criminals[i] == criminals[j] && i == j && criminals[i] > 0)
                {
                    noOfCriminals++;
                }
                i++;
                j--;
            }
            if (j < 0)
            {
                for (int m = i; m < criminals.Length;m++)
                {
                   noOfCriminals += criminals[m];
                }
            }
            if (i == criminals.Length) {
                for (int m = j; m >= 0; m--)
                {
                    m += criminals[m];
                }
            }

            return noOfCriminals;

        }

        static int[] GetInts()
        {
            string[] s = (Console.ReadLine()).Split(' ');
            int[] integers = new int[s.Length];
            for (int i = 0; i < s.Length; i++)
            {
                integers[i] = int.Parse(s[i]);
            }
            return integers;
        }

    }

}


using System;
using System.Text;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
class Problem
{
    static void Main()
    {
        //--------------------------------input--------------------------------//

        int n = Convert.ToInt32( Console.ReadLine() );
        var a = Array.ConvertAll( Console.ReadLine().Split(), Convert.ToInt32 );

        //--------------------------------solve--------------------------------//

        string s = String.Join( "", a );
        if(s.Contains( "23" ) || s.Contains( "32" ) ||s.Contains("11")||s.Contains("22")||s.Contains("33"))
            Console.WriteLine( "Infinite" );
        else
        {
            Console.WriteLine( "Finite" );
            int kq = 0;
            for(int i = 0 ; i < n-1 ; i++)
            {
                if(a[i] + a[i + 1] == 3)
                    kq += 3;
                if(a[i] + a[i + 1] == 4)
                    kq += 4;
            }
            Console.WriteLine( kq );
        }

    }

}


using System.Collections.Generic;
using System.Collections;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.Serialization;
using System.Text.RegularExpressions;
using System.Text;
using System;
using System.Numerics;

class Solution
{
    static int? getCnt(int o, int i)
    {
        if (o == i)
            return null;
        if (o == 2 && i == 3 || o == 3 && i == 2)
            return null;

        if (o == 1)
        {
            return i == 2 ? 3 : 4;
        }
        else if (o == 2)
        {
            return 3;
        }
        else if (o == 3)
        {
            return 4;
        }
        return null;
    }

    static int? getCnt(int o, int i, int i2)
    {
        if (o ==3 && i ==1 && i2==2)
        {
            return 1;
        }

        return null;
    }

    static void Main(string[] args)
    {
        var n = int.Parse(Console.ReadLine().Trim());
        var arr = Array.ConvertAll(Console.ReadLine().Trim().Split(), int.Parse);

        int sum = 0;
        for (int i = 1; i < n; i++)
        {
            var v = getCnt(arr[i - 1], arr[i]);
            if (v == null)
            {
                Console.WriteLine("Infinite");
                return;
            }
            sum+=v.Value;
        }

        for (int i = 2; i < n; i++)
        {
            var v = getCnt(arr[i - 1], arr[i]);
            if (v != null)
            {
               sum-=v.Value;
            }

        }

        Console.WriteLine("Finite");
        Console.WriteLine(sum);

    }

}


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

namespace A810
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] a = Console.ReadLine().Split();
            int n = int.Parse(a[0]);
            int k = int.Parse(a[1]);
            string[] b = Console.ReadLine().Split();
            int[] c = new int[n];
            for (int i = 0; i <n; i++)
            {
                c[i] = int.Parse(b[i]);
            }
            int j = n;
            double d = 0;
            for (int i = 0; i <n; i++)
            {
                d += c[i];
            }
            int m = 0;
            double l = 0;
            if (Math.Round(d / n) == k)
            {
                Console.WriteLine(0);
                return;
            }
            else {
                m = k;
            }
            double res =0;
            while (res != k) {
                d += m;
                j++;
                l = d / j;
                string al = l + "";
                int ma = int.Parse(al[2] + "");
                if ((al[2] == '5')) {
                    res = Math.Round(l) + 1;
                }
                else
                res = Math.Round(l);

            }
            Console.WriteLine(j-n);

        }
    }
}


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

namespace My_pretty_girl_Noora
{
    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 t = Next();
            int l = Next();
            int r = Next();

            var nn = new long[r + 1];
            for (int i = 2; i < nn.Length; i++)
            {
                nn[i] = long.MaxValue;
            }
            nn[1] = 1;
            for (long i = 2; i < nn.Length; i++)
            {
                nn[i] = Math.Min(nn[i], i*(i - 1)/2);

                long max = Math.Min(i*i, r);
                long y = 2;
                for (long j = i + i; j <= max; j += i, y++)
                {
                    nn[j] = Math.Min(nn[j], nn[i] + i*nn[y]);
                }
            }

            long sum = 0;
            long k = 1;
            int mod = 1000000007;

            for (int i = l; i <= r; i++)
            {
                sum = (sum + k*(nn[i]%mod))%mod;
                k = (k*t)%mod;
            }

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

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


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

namespace cf58a
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] ss = Console.ReadLine().Split(' ');
            int n = int.Parse(ss[0]), m = int.Parse(ss[1]);
            int x = 0, left = 0;
            while (n > 0 || left >= m)
                x += left = n + left / m;
            Console.WriteLine(x);
        }
    }
}


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

namespace ConsoleApplication2
{
    class Program
    {
        static int KDel(int n, int m)
        {
            int res = 0;
            for (int i = m; i <= n; i++)
                if (i % m == 0) res += 1;
            return res;
        }

        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            int n = s[0] - (int)'0';
            int m = s[2] - (int)'0';

            int sum = n;
            int w = n;
            while (KDel(w, m) > 0)
            {
                sum += w / m;
                w = KDel(w, m);
            }

            Console.WriteLine(sum);

            Console.ReadLine();
        }
    }
}


using System;

namespace CSharp
{
    class _343A
    {
        public static void Main()
        {
            var tokens = Console.ReadLine().Split();

            long a = long.Parse(tokens[0]);
            long b = long.Parse(tokens[1]);

            int count = 0;

            while (a != b)
            {
                if (a > b)
                {
                    a -= b;
                }
                else
                {
                    b -= a;
                }

                count++;
            }

            Console.WriteLine(count + a);
        }
    }
}


using System;
namespace codeforces
{
    class Program
    {
        static void Main(string[] args)
        {
            string s =Console.ReadLine();

            while (s.Length != 0)
            {
                int count = int.Parse(s[s.Length - 1].ToString());
                string rez = "";
                int r = count % 10;
                if (r - 5 > 0)
                {
                    r -= 5;
                    rez += "-O";
                }
                else
                {
                    rez += "O-";
                }
                int max = 5;
                int z = 4 - r;
                rez += "|";
                while (r != 0)
                {
                    rez += "O";
                    r--;
                    max--;
                }
                rez += "-";
                while (z != 0)
                {
                    rez += "O";
                    z--;
                    max--;
                }
                Console.WriteLine(rez);
                s=s.Substring(0,s.Length-1);
            }
        }
    }
}


using System; using System.Linq;

class P {
  static void Main() {
    var str = Console.ReadLine();
    if (str.Count(char.IsLower) >= str.Count(char.IsUpper)) Console.Write(str.ToLowerCase());
    else Console.Write(str.ToUpperCase());
  }
}


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27004.2005
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CF59A", "CF59A\CF59A.csproj", "{5A951B57-8DAD-4A7D-BDD3-FCC26F69FF67}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU
		Release|Any CPU = Release|Any CPU
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{5A951B57-8DAD-4A7D-BDD3-FCC26F69FF67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{5A951B57-8DAD-4A7D-BDD3-FCC26F69FF67}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{5A951B57-8DAD-4A7D-BDD3-FCC26F69FF67}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{5A951B57-8DAD-4A7D-BDD3-FCC26F69FF67}.Release|Any CPU.Build.0 = Release|Any CPU
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
	GlobalSection(ExtensibilityGlobals) = postSolution
		SolutionGuid = {E15CB28E-F46B-489C-9A88-192352E4FC30}
	EndGlobalSection
EndGlobal


//A. Is your horseshoe on the other hoof?
#define TRY

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

public class ArrayX
{
  public static void Main ( )
  {
#if TRY
    Console.SetIn ( new StreamReader ( @"e:\zin.txt" ) );

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

  private static void solve ( )
  {
    int[] ii = ReadLineToInts ( );
    Dictionary<int,int> colors = new Dictionary<int, int> ( );
    foreach ( int i in ii )
    {
      colors[i] = 1;
    }

    Console.WriteLine ( 4 - colors.Keys.Count );
  }

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

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

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

}


using System;

namespace CSharpEdu
{
    class ClassCS
    {
        struct point
        {
            public int h;
            public int v;
        }
        static int abs (int x)
        {
            return x > 0 ? x : -x;
        }
        static void Main()
        {
            string s;
            int i, j, tmp;
            bool flag = false;
            point Imlookingfor1;
            for (i = 1; i <= 5; ++i)
            {
                s = Console.ReadLine();
                tmp = 0;
                for (j = 0; j<s.Length; ++j)
                {
                    if (s[j] != 32)
                    {
                        tmp++;
                    }
                    if (s[j] == '1')
                    {
                        Imlookingfor1.h = i;
                        Imlookingfor1.v = tmp;
                        flag = true;
                        break;
                    }
                }
                if (flag) break;
            }
            int res = abs(Imlookingfor1.h - 3) + abs(Imlookingfor1.v - 3);
            Console.Write(res);
            //Console.ReadKey();
        }
    }
}


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "beutiful matrix", "beutiful matrix\beutiful matrix.csproj", "{C1C1A884-AD91-4664-A2F2-E829F26D75E0}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU
		Release|Any CPU = Release|Any CPU
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{C1C1A884-AD91-4664-A2F2-E829F26D75E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{C1C1A884-AD91-4664-A2F2-E829F26D75E0}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{C1C1A884-AD91-4664-A2F2-E829F26D75E0}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{C1C1A884-AD91-4664-A2F2-E829F26D75E0}.Release|Any CPU.Build.0 = Release|Any CPU
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
EndGlobal


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "maximum_in_table", "maximum_in_table\maximum_in_table.csproj", "{0A4645B1-EACC-4BD5-A836-243EF8E4F323}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|x86 = Debug|x86
		Release|x86 = Release|x86
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{0A4645B1-EACC-4BD5-A836-243EF8E4F323}.Debug|x86.ActiveCfg = Debug|x86
		{0A4645B1-EACC-4BD5-A836-243EF8E4F323}.Debug|x86.Build.0 = Debug|x86
		{0A4645B1-EACC-4BD5-A836-243EF8E4F323}.Release|x86.ActiveCfg = Release|x86
		{0A4645B1-EACC-4BD5-A836-243EF8E4F323}.Release|x86.Build.0 = Release|x86
	EndGlobalSection
EndGlobal


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

using System.Text.RegularExpressions;

class Program
{
    static public int[] readIntArray()
    {
        return (from string s in Console.ReadLine().Split(' ') select Convert.ToInt32(s)).ToArray();
    }
    static public long[] readLongArray()
    {
        return (from string s in Console.ReadLine().Split(' ') select Convert.ToInt64(s)).ToArray();
    }
    static public ulong[] readULongArray()
    {
        return (from string s in Console.ReadLine().Split(' ') select Convert.ToUInt64(s)).ToArray();
    }
    public static int readInt()
    {
        return Convert.ToInt32(Console.ReadLine());
    }

    static void Main(string[] args)
    {

        RountineProblem();
    }
    static void RountineProblem()
    {
        int[] arr = readIntArray();
        int bc = arr[1] * arr[2];
        int ad = arr[0] * arr[3];
        int up = 0;
        int down = 0;
        if (bc > ad)
        {
            up = bc - ad;
            down = bc;
        }
        else
        {
            up = ad - bc;
            down = ad;
        }
        for(int i = 2; i <= down; i++)
        {
            if(up%i==0 && down % i == 0)
            {
                up /= i;
                down /= i;
            }
        }
        if (up == 0) { down = 1; }
        Console.WriteLine("{0}/{1}",up,down);
    }


using system;

public static void main()
{
    int count, zeroCount;
    string binaryNumber;

    count = int.Parse(Console.ReadLine());
    binaryNumber = Console.ReadLine();

    for(int i = 0;i<binaryNumber.Length;i++)
    {
        if(binaryNumber[i] == '0')
            zeroCount++;
    }

    Console.Write("1");
    for(int i=0;i<zeroCount;i++)
    {
        Console.Write("0");
    }
    Console.WriteLine();

}


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

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

            string ans = "";
            int n = int.Parse(Console.ReadLine());
            string s = Console.ReadLine();

            int start = s.IndexOf('1');
            int zeros = 0;
            for (int i = start; i < s.Length; i++)
                if (s[i] == '0')
                    zeros++;

            ans = ans + "1";
            while (zeros != 0)
            {
                ans += "0";
                zeros--;
            }

            Console.WriteLine(ans);

        }
    }
}


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

namespace ConsoleApplication11
{
    class Program
    {
        static void Main(string[] args)
        {
            int n,b=0,m;
            int noll=0;

            n=int.Parse(Console.ReadLine());
            int s = int.Parse(Console.ReadLine());
            m = s;
            int[] a = new int[n];
            for(int i=0;i<n;i++)
            {
                a[i] = s % 10;
                s = s / 10;
            }

          //  Console.Write(a);

            for(int i=0;i<a.Length;i++)
            {
                if(a[i]==0)
                {
                    noll = noll + 1 ;
                }
            }

            //int[] b = new int[noll + 1];

            if (noll == n - 1)
            {
                Console.WriteLine(m.ToString());
            }
            else
            {
                for(int i=0;i<noll+1;i++)
                {

                    if (i==0)
                    {
                        b = 1;
                    }
                    else
                    {
                        b=b*10;
                    }
                }
                Console.WriteLine(b.ToString());
            }

        }
    }
}


using System;
using System.Text;
using System.Linq;

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

            int numZero = s.Count(item => item == '0');
            if (!s.Contains("1")) Console.WriteLine(s);
            else {

                Console.Write("1");
                for (int i = 0; i < numZero; i++) Console.Write("0");

            }

        }
    }
}

        }
    }
}


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

namespace Contest
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine().Split(), Convert.ToInt32);
            int[] a = new int[n];
            a[0] = 1;
            for (int i = 1; i < n; i++)
                a[i] = a[i - 1] + 4*i;
            Console.WriteLine(a[n-1]);
        }
    }
}


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

// (づ*ω*)づﾐ★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜
public class Solver
{
    public object Solve()
    {
        string s = ReadToken();
        int ans = 0;
        int c = 0;
        for (int i = 0; i < s.Length; i++)
        {
            ans += (s.Length - i) * Math.Abs(s[i] - '0' - c);
            c = s[i] - '0';
        }

        return ans;
    }

    #region Main

    protected static TextReader reader;
    protected static TextWriter writer;

    static void Main()
    {
#if DEBUG
        reader = new StreamReader("..\\..\\input.txt");
        writer = Console.Out;
        //writer = new StreamWriter("..\\..\\output.txt");
#else
        reader = Console.In;
        writer = new StreamWriter(Console.OpenStandardOutput());
#endif
        try
        {
            object result = new Solver().Solve();
            if (result != null)
                writer.WriteLine(result);
        }
        catch (Exception ex)
        {
#if DEBUG
            Console.WriteLine(ex);
#else
            throw;
#endif
        }
        reader.Close();
        writer.Close();
    }

    #endregion

    #region Read/Write

    private static Queue<string> currentLineTokens = new Queue<string>();

    private static string[] ReadAndSplitLine()
    {
        return reader.ReadLine().Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
    }

    public static string ReadToken()
    {
        while (currentLineTokens.Count == 0)
            currentLineTokens = new Queue<string>(ReadAndSplitLine());
        return currentLineTokens.Dequeue();
    }

    public static int ReadInt()
    {
        return int.Parse(ReadToken());
    }

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

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

    public static int[] ReadIntArray()
    {
        return ReadAndSplitLine().Select(int.Parse).ToArray();
    }

    public static long[] ReadLongArray()
    {
        return ReadAndSplitLine().Select(long.Parse).ToArray();
    }

    public static double[] ReadDoubleArray()
    {
        return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();
    }

    public static int[][] ReadIntMatrix(int numberOfRows)
    {
        int[][] matrix = new int[numberOfRows][];
        for (int i = 0; i < numberOfRows; i++)
            matrix[i] = ReadIntArray();
        return matrix;
    }

    public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)
    {
        int[][] matrix = ReadIntMatrix(numberOfRows);
        int[][] ret = new int[matrix[0].Length][];
        for (int i = 0; i < ret.Length; i++)
        {
            ret[i] = new int[numberOfRows];
            for (int j = 0; j < numberOfRows; j++)
                ret[i][j] = matrix[j][i];
        }
        return ret;
    }

    public static string[] ReadLines(int quantity)
    {
        string[] lines = new string[quantity];
        for (int i = 0; i < quantity; i++)
            lines[i] = reader.ReadLine().Trim();
        return lines;
    }

    public static void WriteArray<T>(IEnumerable<T> array)
    {
        writer.WriteLine(string.Join(" ", array));
    }

    #endregion
}


using System;

namespace Achill
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = int.Parse(Console.ReadLine());
            int l = int.Parse(Console.ReadLine()), res = 0;
            bool flag = k == l;
            while(k <= l && !flag)
            {
                k *= k;
                flag = k == l;
                ++res;
            }
            if(flag)
            {
                Console.WriteLine("YES");
                Console.WriteLine(res);
            }
            else
            {
                Console.WriteLine("NO");
            }
        }
    }
}


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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            double k;
            int l;
            Boolean a = false;
            k = Int32.Parse(Console.ReadLine());
            l = Int32.Parse(Console.ReadLine());
            if (k == l)
            {
                Console.WriteLine("YES");
                Console.WriteLine(0);
            }
            else
            {
                for (int i = 1; i < 191102979; i++)
                {
                    k = k * k;
                    if (k == l)
                    {
                        Console.WriteLine("YES");
                        Console.WriteLine(i);
                        a = true;
                        break;
                    }
                }
                if (a == false)
                    Console.WriteLine("NO");
            }
            Console.Read();
        }
    }
}


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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            double k;
            int l;
            Boolean a = false;
            k = Int32.Parse(Console.ReadLine());
            l = Int32.Parse(Console.ReadLine());
            int m = (int)k;
            if (k == l)
            {
                Console.WriteLine("YES");
                Console.WriteLine(0);
            }
           else if
            {
                for (int i = 1; i < 6911090; i++)
                {
                    k = k * m;
                    if (k >= l)
                    {
                        if (k == l)
                        {
                            Console.WriteLine("YES");
                            Console.WriteLine(i);
                            a = true;
                        }
                        break;
                    }
                    else if (k > l)
                        break;
                }
                if (a == false)
                    Console.WriteLine("NO");
            }
            Console.Read();
        }
    }
}


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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            double k;
            int l;
            Boolean a = false;
            k = Int32.Parse(Console.ReadLine());
            l = Int32.Parse(Console.ReadLine());
            int m = (int)k;
            if (k == l)
            {
                Console.WriteLine("YES");
                Console.WriteLine(0);
            }
           else
            {
                for (int i = 1; i < 6911090; i++)
                {
                    k = k * m;
                    if (k >= l)
                    {
                        if (k == l)
                        {
                            Console.WriteLine("YES");
                            Console.WriteLine(i);
                            a = true;
                        }
                        break;
                    }
                    else if (k > l)
                        break;
                }
                if (a == false)
                    Console.WriteLine("NO");
            }
            Console.Read();
        }
    }


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

namespace run
{
    class Program
    {

        static double Decim(int a, int b)
        {
            if (b != 0)
                return Convert.ToDouble(a) / Convert.ToDouble(b);
            else
                return 0;
        }

        static void Main(string[] args)
        {
            string s = Console.ReadLine().Trim();
            string[] arrS = s.Split(' ');
            int x = Convert.ToInt32(arrS[0]);
            int y = Convert.ToInt32(arrS[1]);
            int z = Convert.ToInt32(arrS[2]);
            int ra = 0, rb = 1, a, b;

            {
                double d = Decim(x, y);
                double minD = 99999;
                for (int i1 = 1; i1 <= z; i1++)
                {
                    b = i1;
                    a = Convert.ToInt32(Math.Truncate(d * b));
                    if (Math.Abs(d - Decim(a, b)) < Math.Abs(minD))
                    {
                        minD = d - Decim(a, b);
                        ra = a;
                        rb = b;
                    }
                    if (a < d * b)
                    {
                        a++;
                        if (Math.Abs(d - Decim(a, b)) < Math.Abs(minD))
                        {
                            minD = d - Decim(a, b);
                            ra = a;
                            rb = b;
                        }
                    }
                }
            }

            Console.WriteLine(ra.ToString() + @"/" + rb.ToString());
            Console.Read();
        }
    }
}


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

namespace Codeforce
{

    class Program
    {
        static int[] parseInt(string s)
        {
            string[] temp = s.Split(' ');
            int[] res = new int[temp.Length];
            for (int i = 0; i < temp.Length; i++)
            {
                res[i] = Convert.ToInt32(temp[i]);
            }
            return res;
        }

        static int gcd(int a, int b)
        {

            int rem;
            if (b == 0)
                return a;

            while (true)
            {
                rem = a % b;
                if (rem == 0)
                    break;

                a = b;
                b = rem;
            }
            return b;
        }

        static int lcm(int a, int b)
        {
            return (a / gcd(a, b) * b);
        }

        static void Main(string[] args)
        {
            var data = parseInt(Console.ReadLine());

            int resA = -1, resB = -1;
            double min = double.MaxValue;
            double x = data[0], y = data[1];
            for (int i = 1; i < data[2] + 1; i++)
            {
                double temp = (x * (double)i) / y;

                for (int j = (int)temp - 1; j < temp + 2; j++)
                {
                    double t1 = Math.Abs((x / y) - (double)((double)j / (double)i));
                    if (j >= 0 && t1 >= 0 && min > t1)
                    {
                        min = t1;
                        resA = j;
                        resB = i;
                    }
                }
            }

            int g = gcd(resA, resB);

            Console.WriteLine("{0}/{1}",resA / g, resB / g);
        }
    }
}


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

namespace Codeforce
{

    class Program
    {
        static int[] parseInt(string s)
        {
            string[] temp = s.Split(' ');
            int[] res = new int[temp.Length];
            for (int i = 0; i < temp.Length; i++)
            {
                res[i] = Convert.ToInt32(temp[i]);
            }
            return res;
        }

        static int gcd(int a, int b)
        {

            int rem;
            if (b == 0)
                return a;

            while (true)
            {
                rem = a % b;
                if (rem == 0)
                    break;

                a = b;
                b = rem;
            }
            return b;
        }

        static int lcm(int a, int b)
        {
            return (a / gcd(a, b) * b);
        }

        static void Main(string[] args)
        {
            var data = parseInt(Console.ReadLine());

            int resA = -1, resB = -1;
            double min = double.MaxValue;
            double x = data[0], y = data[1];
            for (int i = 1; i < data[2] + 1; i++)
            {
                double temp = (int)(x * (double)i) / y;

                for (int j = temp - 1; j < temp + 2; j++)
                {
                    double t1 = Math.Abs((x / y) - (double)((double)j / i));
                    if (j >= 0 && t1 >= 0 && min > t1)
                    {
                        min = t1;
                        resA = j;
                        resB = i;
                    }
                }
            }

            int g = gcd(resA, resB);

            Console.WriteLine("{0}/{1}",resA / g, resB / g);
        }
    }
}