using System;
{
    class Program
    {
        static void Main(string[] args)
        {
            int n , temp;

            n= Convert.ToInt32(Console.ReadLine());

            temp = (n*(n+1))/ 2;

            Console.WriteLine(temp % 2);
        }
    }
}


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28010.2036
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ForCodeforces", "ForCodeforces\ForCodeforces.csproj", "{9372C2A1-BA75-45D9-8BA0-2C6EBC15BD1C}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU
		Release|Any CPU = Release|Any CPU
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{9372C2A1-BA75-45D9-8BA0-2C6EBC15BD1C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{9372C2A1-BA75-45D9-8BA0-2C6EBC15BD1C}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{9372C2A1-BA75-45D9-8BA0-2C6EBC15BD1C}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{9372C2A1-BA75-45D9-8BA0-2C6EBC15BD1C}.Release|Any CPU.Build.0 = Release|Any CPU
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
	GlobalSection(ExtensibilityGlobals) = postSolution
		SolutionGuid = {4412A573-E066-4AE4-B95A-69ED731622F1}
	EndGlobalSection
EndGlobal


 char[] vowels = { 'a', 'e', 'i', 'o', 'u', 'y' };
            int inputLetterSize = int.Parse(Console.ReadLine());
            string letter = Console.ReadLine();
            StringBuilder letterBilder = new StringBuilder(letter);

            for (int i = 0; i < letterBilder.Length-1; i++)
            {
                if (vowels.Contains(letterBilder[i])){
                    if (vowels.Contains(letterBilder[i + 1])) { letterBilder.Remove(i + 1, 1); i--; }

                }
            }

            //for (int i = 1; i < letterBilder.Length; i++)
            //{
            //    if(vowels.Contains(letterBilder[i]))
            //    {
            //        if (vowels.Contains(letterBilder[i - 1]))
            //        { letterBilder.Remove(i, 1);
            //            i = 0;
            //        }
            //    }
            //}
            Console.WriteLine(letterBilder);


namespace ConsoleApplication89
{
    class Prog
    {
        static void Main(string[] args)
        {

            int n;
            string s;

            n =int.Parse(Console.ReadLine());
            s = Console.ReadLine();

            string vowel = "aeiouy";

            for (int i = 0; i < s.Length-1; ++i)
            {
                if(vowel.Contains(s[i]) && vowel.Contains(s[i+1]) )
                {
                    s = s.Remove(i+1, 1);
                }
            }
            Console.WriteLine(s);
        }
    }
}


using System;

namespace Буквы
{
    class Program
    {
        static void Main(string[] args)
        {
            string G = "aouiey";

            bool Flag = false;
            int N = Convert.ToInt32(Console.ReadLine());
            for (int i = 0; i < N; i++)
            {
                char c = (char)Console.Read();
                if (G.Contains(c) == false)
                {
                    Flag = false;
                    Console.Write(c);
                }
                else//(G.Contains(c) == true)
                {
                    if (Flag==false)
                    {
                        Console.Write(c);

                    }
                    Flag = true;
                }

            }
            Console.WriteLine();
        }
    }
}


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

namespace A.Николай_и_перестановка
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            var mas = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int l = mas.Length;
            int pol = (l + 1) / 2;
            int i = 0;
            int imin = 0, imax = 0;

            foreach (int x in mas)
            {
                if (x == 1) imin = i+1;
                else if (x == l) imax = i+1;
                i++;
            }

            if (imin <= pol && imax <= pol)
            {
                if (imin > imax) imin = l;
                else imax = l;
            }
            else if (imin > pol && imax > pol)
            {
                if (imin < imax) imin = 1;
                else imax = 1;
            }
            else if (imin <= pol)
            {
                if (pol - imin >= imax - pol) imax = l;
                else imin = 1;
            }
            else
            {
                if (pol - imax >= imin - pol) imin = l;
                else imax = 1;
            }

            //Console.WriteLine("Индекс мин = " + imin + "\nИндекс max = " + imax);
            Console.WriteLine(Math.Abs(imax-imin));
            Console.ReadLine();

        }
    }


using System.Linq;
using System.Xml;
using System.Xml.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CD
{
    class Program
    {
        static void Main(string[] args)
        {
int size = Convert.ToInt32(Console.ReadLine());
            int[] arr = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
            for (int i = 0; i < size; i++)
            {
                if ((arr[i] == 1) || (arr[i] == size))
                {
                    int s = size - 1 - i;
                    int b = i + 1;
                    Console.WriteLine(b>s?b:s);
                    break;
                }
            }}}}


using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.ObjectModel;
using System.Data;

namespace ConsoleApplicationTest
{
    class Program
    {
        static void Main(string[] args)
        {
            Int32[] arry = new Int32[5];
            int count = Convert.ToInt32(Console.ReadLine());
            if (count < 2 || count > 100) { throw new Exception("Out of Range"); }
            string[] x_temp = Console.ReadLine().Split(' ');
            int[] initArry = Array.ConvertAll(x_temp, Int32.Parse);
            if (initArry.Distinct().Count() != initArry.Length) { throw new Exception("Elements should be distinct"); }
            for (int i = 0; i < initArry.Length; i++) { if (initArry[i] < 1) { throw new Exception("Element should be greater than one"); } }
            int maxIndex = initArry.ToList().IndexOf(initArry.Max()) + 1;
            int minIndex = initArry.ToList().IndexOf(initArry.Min()) + 1;
            if (((maxIndex == 1) || (maxIndex == count)) && ((minIndex == 1) || (minIndex == count)))
            {
                Console.WriteLine(Math.Abs(maxIndex - minIndex));
            }
            else
            {

                arry[0] = Math.Abs(count - minIndex);
                arry[1] = Math.Abs(1 - minIndex);
                arry[2] = Math.Abs(1 - maxIndex);
                arry[3] = Math.Abs(count - maxIndex);
                Console.WriteLine(arry.ToList().Max());
            }
			}
			}
			}


 private static int SoldierBananna(int k, int n, int w)
 {
    int sum = k*(w+1)*w/2;
    return Math.Max(0, sum-n);
 }


    public class Program
    {
        static void Main(string[] args)
        {
            string []arr = Console.ReadLine().Split(' ');
            long k = Convert.ToInt64(arr[0]);
            long n = Convert.ToInt64(arr[1]);
            long w = Convert.ToInt64(arr[2]);

            //long r = w * k;
            //long y = w + 1;
            //long u = r * y;
            //long q = u / 2;
            long t =Math.Abs(  (  (k*w)*(w+1)/2 )-n  );
            Console.WriteLine(t);

        }
    }


using System;
    internal class Program
    {
        private static void Main(string[] args)
        {
            var d = Console.ReadLine().Split().Select(Int32.Parse).ToArray();
            int n = d[1], k = d[0], w = d[2];
            var result = w * ((float)(k + w * k) / 2) - n;
            Console.WriteLine(result >= 0 ? result : 0);
        }
    }


int sum = 0;
            var s = Console.ReadLine().Split().Select( par  => int.Parse(par)).ToArray();
            while(s[2] > 0){
                sum += s[0]*s[2];
                s[2]--;
            }
            Console.WriteLine(sum - s[1]);


using System;
using System.Linq;

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

            int singlePrice = inputs[0];
            int money = inputs[1];
            int numberOfBananas = inputs[2];

            int price = 0;
            for (int i = 0; i < numberOfBananas; i++)
            {
                price += singlePrice * (i+1);
            }

            Console.WriteLine(Math.Clamp(price - money, 0,10000000));

        }
    }
}


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30413.136
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Soldado_y_Platanos", "Soldado_y_Platanos\Soldado_y_Platanos.csproj", "{C2CD1643-5AC3-4724-8E38-D4A69546AF69}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU
		Release|Any CPU = Release|Any CPU
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{C2CD1643-5AC3-4724-8E38-D4A69546AF69}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{C2CD1643-5AC3-4724-8E38-D4A69546AF69}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{C2CD1643-5AC3-4724-8E38-D4A69546AF69}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{C2CD1643-5AC3-4724-8E38-D4A69546AF69}.Release|Any CPU.Build.0 = Release|Any CPU
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
	GlobalSection(ExtensibilityGlobals) = postSolution
		SolutionGuid = {B094B43C-EA01-45AE-9785-A207B454959D}
	EndGlobalSection
EndGlobal


class A_Soldier_and_Bananas
    {
        public static void Run()
        {
            int cost, USD, bananas, totalCost = 0;

            string[] tokens = Console.ReadLine().Split();

            cost = int.Parse(tokens[0]);
            USD = int.Parse(tokens[1]);
            bananas = int.Parse(tokens[2]);

            while (bananas != 0)
            {
                totalCost += cost*bananas;
                bananas--;
            }

            Console.WriteLine(totalCost - USD);
        }
    }


using System;

        static void Main(string[] args)
        {
            int cost, USD, bananas, totalCost = 0;

            string[] tokens = Console.ReadLine().Split();

            cost = int.Parse(tokens[0]);
            USD = int.Parse(tokens[1]);
            bananas = int.Parse(tokens[2]);

            while (bananas != 0)
            {
                totalCost += cost*bananas;
                bananas--;
            }

            Console.WriteLine(totalCost - USD);
        }


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

namespace Codeforces
{
    class Class9
    {
        public static void Main_18()
        {
            int a = int.Parse(Console.ReadLine());
            int[] s = { 4, 7, 44, 47, 74, 77, 444, 447, 474, 477, 744, 747, 747, 777 };

            for (int j = 0; j < 14; j++)
            {
                if (a % s[j] == 0)
                {
                    Console.WriteLine("YES");
                    return;
                }
            }
            Console.WriteLine("NO");
        }
    }
}


class Program
    {
        static void Main(string[] args)
        {
            int cost, USD, bananas, totalCost = 0;

            string[] tokens = Console.ReadLine().Split();

            cost = int.Parse(tokens[0]);
            USD = int.Parse(tokens[1]);
            bananas = int.Parse(tokens[2]);

            while (bananas != 0)
            {
                totalCost += cost*bananas;
                bananas--;
            }

            Console.WriteLine(totalCost - USD);
        }
    }


using System;

class A_Soldier_and_Bananas
    {
        public void Run()
        {
            int cost, USD, bananas, totalCost = 0;

            string[] tokens = Console.ReadLine().Split();

            cost = int.Parse(tokens[0]);
            USD = int.Parse(tokens[1]);
            bananas = int.Parse(tokens[2]);

            while (bananas != 0)
            {
                totalCost += cost*bananas;
                bananas--;
            }

            Console.WriteLine(totalCost - USD);
        }
    }


namespace Codeforces
{
    class TestClass
    {
        static void Main(string[] args)
        {
            int k = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            int w = int.Parse(Console.ReadLine());

            for (int i = 0; i <= w; ++i)
            {
                n -= i * k;
            }

            n = -n;

            Console.WriteLine(n);

        }
    }
}


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

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

            string[] tokens = Console.ReadLine().Split(' ');

            Int32 k = Int32.Parse(tokens[0]);
            Int32 n = Int32.Parse(tokens[1]);
            Int32 w = Int32.Parse(tokens[2]);

            Int32 s = 0;

            for (int i=1;i<=w;i++)
            {

                s = s + i * k;

            }

            int r = s - n;

            if (r == 0) Console.WriteLine(0);
            if (r > 0) Console.WriteLine(r);
            if (r < 0) Console.WriteLine(0);

            --while (Console.ReadKey().Key != ConsoleKey.Enter) { }

        }
    }
}


using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Diagnostics;
using System.IO;
using System.IO.Pipes;
using System.Text;

namespace CSharpInNutshellTest
{
    internal sealed class Program
    {

        private static int SoldierBanana(int k, int n, int w)
        {
            int sum = k*(w+1)*w/2;
            return Math.Max(0, sum-n);
        }

         private static void Main(string[] args)
        {
            Console.WriteLine(SoliderBanana(args[0], args[1], args[2]);
        }
     }
}


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

namespace soldierandbananas
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');
            long k = long.Parse(input[0]);
            long n = long.Parse(input[1]);
            long w = long.Parse(input[2]);
            long req =long.Max( (((k * w) / 2) * (1 + w)) - n,0);
            Console.WriteLine(req);
        }
    }
}


static void Main(string[] args)
        {
            int cost, USD, bananas, totalCost = 0;

            string[] tokens = Console.ReadLine().Split();

            cost = int.Parse(tokens[0]);
            USD = int.Parse(tokens[1]);
            bananas = int.Parse(tokens[2]);

            while (bananas != 0)
            {
                totalCost += cost*bananas;
                bananas--;
            }

            Console.WriteLine(totalCost - USD);
        }


using System;

class A_Soldier_and_Bananas
    {
        public static void main()
        {
            int cost, USD, bananas, totalCost = 0;

            string[] tokens = Console.ReadLine().Split();

            cost = int.Parse(tokens[0]);
            USD = int.Parse(tokens[1]);
            bananas = int.Parse(tokens[2]);

            while (bananas != 0)
            {
                totalCost += cost*bananas;
                bananas--;
            }

            Console.WriteLine(totalCost - USD);
        }
    }


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

namespace _546A
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] arr = Console.ReadLine().Split(' ');
            int k = Convert.ToInt32(arr[0]);
            int n = Convert.ToInt32(arr[1]);
            int w = Convert.ToInt32(arr[2]);
            int res = 0;
            for (int i = 1; i <= w; i++)
            {
                res += i;
            }
            res = k * res;
            if (n-res>=0)
                Console.WriteLine(0);
            else
                Console.WriteLine(res-n);
            Console.ReadKey();
        }
    }
}


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

namespace _41a
{

    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            int k = int.Parse(s[0]);
            int n = int.Parse(s[1]);
            int w = int.Parse(s[2]);
            int y = 0;

                for (int i = 1; i <= w; i++)
                {
                    y = y + (i * k);
                }
                 if(y>n)
            {
                Console.WriteLine(y - n);
            }
            else
            {
                Console.WriteLine(0);
            }
            }
        }
    }
}


using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Diagnostics;
using System.IO;
using System.IO.Pipes;
using System.Text;

namespace CSharpInNutshellTest
{
    internal sealed class Program
    {

        private static int SoldierBanana(int k, int n, int w)
        {
            int sum = k*(w+1)*w/2;
            return Math.Max(0, sum-n);
        }

         private static void Main(string[] args)
        {
            Console.WriteLine(SoldierBanana(args[0], args[1], args[2]));
        }
     }
}


using System;

class A_Soldier_and_Bananas
    {
        public static void Run()
        {
            int cost, USD, bananas, totalCost = 0;

            string[] tokens = Console.ReadLine().Split();

            cost = int.Parse(tokens[0]);
            USD = int.Parse(tokens[1]);
            bananas = int.Parse(tokens[2]);

            while (bananas != 0)
            {
                totalCost += cost*bananas;
                bananas--;
            }

            Console.WriteLine(totalCost - USD);
        }
    }


using System;
using System.Collections.Generic;

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

            int sum = 0;
            var s = Console.ReadLine().Split().Select( par  => int.Parse(par)).ToArray();
            while(s[2] > 0){
                sum += s[0]*s[2];
                s[2]--;
            }
            Console.WriteLine(sum - s[1]);

        }
    }
}


using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Diagnostics;
using System.IO;
using System.IO.Pipes;
using System.Text;

namespace CSharpInNutshellTest
{
    internal sealed class Program
    {

        private static int SoldierBanana(int k, int n, int w)
        {
            int sum = k*(w+1)*w/2;
            return Math.Max(0, sum-n);
        }

         private static void Main(string[] args)
        {
            Console.WriteLine(SoliderBanana(args[0], args[1], args[2]));
        }
     }
}


class Something
    {
        static void Main(string[] args)
        {
            String[] paramz = Console.ReadLine().Split(' ');
            int n = Convert.ToInt16(paramz[0]);
            int ptctr = Convert.ToInt16(paramz[1]) - 1;

            String[] input = Console.ReadLine().Split(' ');

            if (Convert.ToInt16(input[ptctr]) != 0)
            {
                while (ptctr < n)
                {
                    if (Convert.ToInt16(input[ptctr + 1]) == Convert.ToInt16(input[ptctr]))
                    {
                        ptctr++;
                    }
                    else
                        break;
                }
            }
            else
            {
                while (ptctr >= 0)
                {
                    if (Convert.ToInt16(input[ptctr]) == 0)
                    {
                        ptctr--;
                    }
                    else
                    {
                        break;
                    }
                }
            }

            Console.Write(ptctr + 1);
        }

    }


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

namespace CSharp_Shell
{

    public static class Program
    {
        public static void Main()
        {
          int k=0,p,m=0;
          string [] palo= Console.ReadLine().Split();
          int p1=int.Parse(palo[1]);
          p=int.Parse(palo[0]);
          string [] paloso=Console.ReadLine().Split();
          for(int z=0 ; z<p ; z++)
          {
              k=int.Parse(paloso[z]);
              if(k>p1 && k>=0)
              {
                  m++;
              }
              else if (k==1 && p1==1)
              {
                  m++
              }
          }
          Console.WriteLine(m);
        }
    }
}


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

/**
 * Auto-generated code below aims at helping you parse
 * the standard input according to the problem statement.
 **/
class Solution
{
    static void Main(string[] args)
    {
        string[] Numbers = Console.ReadLine().Split(' ');
        int N = int.Parse(Numbers[0]);
        int K = int.Parse(Numbers[1]);
        string[] Scores = Console.ReadLine().Split(' ');
        int count = 0;
        for(int i = 0 ; i < N ; i++){
            int score = int.Parse(Scores[i]);
            if(score < k)
                break;
            count++;
        }
        Console.WriteLine(Score);
    }
}


using System;
class solution
{
    static void Main(String []args)
    {
        string[] tokens=Console.ReadLine().Split();
        int n=int.Parse(tokens[0]);
        int k=int.Parse(tokens[1]);
        tokens=Console.ReadLine().Split();
        int length=0;
        for(int i=0;i<tokens.Length;i++)
        {
            if(int.Parse(tokens[(tokens.Length-i-1)])>k && int.Parse(tokens[tokens.Length-i-1])>0)
            {
                length=tokens.Length-i;
                break;
            }
            else if(int.Parse[tokens[0]==k])
            {
                k=k-1;
            }

        }
        Console.WriteLine(length);

    }
}


class P_158A
    {
        public P_158A() { }

        public void Run()
        {
            String[] paramz = Console.ReadLine().Split(' ');
            int n = Convert.ToInt16(paramz[0]);
            int ptctr = Convert.ToInt16(paramz[1]) - 1;

            String[] input = Console.ReadLine().Split(' ');

            if (Convert.ToInt16(input[ptctr]) != 0)
            {
                while (ptctr < n)
                {
                    if (Convert.ToInt16(input[ptctr + 1]) == Convert.ToInt16(input[ptctr]))
                    {
                        ptctr++;
                    }
                    else
                        break;
                }
            }
            else
            {
                while (ptctr >= 0)
                {
                    if (Convert.ToInt16(input[ptctr]) == 0)
                    {
                        ptctr--;
                    }
                    else
                    {
                        break;
                    }
                }
            }

            Console.Write(ptctr + 1);
        }

    }


using System;

class Program
{
	static void Main(string[] args)
	{
		int count1=0;
		int k=0;
		string []tmp1 = Console.ReadLine().Split(' ');
     	string []tmp2 = Console.ReadLine().Split(' ');

		while(count1<tmp1[1]))
		{

		    for (int i=0;i<int.Parse(tmp1[0]);i++)
		     {

		        if(int.Parse(tmp2[k])==int.Parse(tmp2[i]))
		        count1++;
		         else
		         break;
		     }

		      k++;
		}

		}

		Console.WriteLine(count1);
	}
}


using System;
using System.Linq;
class Task
{
    static void Main()
    {
        string[] arr=Console.ReadLine().Split(' ');
        int n=int.Parse(arr[0]);
        int k=int.Parse(arr[1]);
        int ne[n];
        int c=0;
        for(int i=0;i<n;i++)
        {
            ne[i]=int.Parse(Console.ReadLine());
        }

        for(int i=0;i<n;i++)
        {
            if(ne[i]>k && ne[i]>=0)
            {
                c++;
            }
        }
        Console.WriteLine(c);

    }

}


using System;

class Program
{
	static void Main(string[] args)
	{
		int count1=0;
		string []tmp1 = Console.ReadLine().Split(' ');
     	string []tmp2 = Console.ReadLine().Split(' ');

		for (int i=0;i<tmp1[0];i++)
		{
		    if(tmp2[i]>tmp1[1])
		    count1++;
		    else
		    break;
		}

		Console.WriteLine(count1);
	}
}


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

namespace prob4_Next_round
{
    class Program
    {
        static void Main(string[] args)
        {
            var inputs = Console.ReadLine();
            var contestantsScores = Console.ReadLine();

            var inputsSplit = inputs.Split(' ');
            var contestantsNumbern =Convert.ToInt32(inputsSplit[0]);
            var scoreK = Convert.ToInt32(inputsSplit[1]) ;

            var contestantsScoreSplit = contestantsScores.Split(' ');
            var countList = new List<int>();

            if (contestantsNumbern <= 50 && scoreK >= 1 ){
                var count = Count(scoreK);
                Console.WriteLine(count);

            }

            int Count(int count)
            {
                foreach (var contestantScore in contestantsScoreSplit)
                {
                    if (contestantsScoreSplit.Length <= contestantsNumbern)
                    {
                        var intContestantScore = Convert.ToInt32(contestantScore);
                        int[] scoresArray = Array.ConvertAll(contestantsScoreSplit, int.Parse);
                        if (intContestantScore >= scoresArray[scoreK] && intContestantScore > 0 && intContestantScore <= 100)
                        {
                            countList.Add(intContestantScore);

                        }
                    }
                }
                int output = countList.Count;
                return output;

            }
        }
    }
}


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

          var initial_input =  Console.ReadLine();
            string first_range = initial_input.Substring(0, 1);
            int first_range_num = Int32.Parse(first_range);
            string last_range = initial_input.Substring(2);
            int last_range_num = Int32.Parse(last_range);

           var initial_input_2 = Console.ReadLine();

            int[] somthing = Array.ConvertAll(initial_input_2.Split(' '), int.Parse);

            int c = 0;

            int qualification_score = somthing[last_range_num];

             for (int i = 0; first_range_num > i; i++)
             {
                 if(qualification_score <= somthing[i])
                 {
                     c++;
                 }
                 if(qualification_score == 0)
                {
                    c = 0;
                }
                 else
                 {

                 }
             }
             Console.WriteLine(c);
        }
    }
}


<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{2E20431D-E3F5-4D61-9877-3CA732EC7462}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>ConsoleApplication18</RootNamespace>
    <AssemblyName>ConsoleApplication18</AssemblyName>
    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Core" />
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Data.DataSetExtensions" />
    <Reference Include="Microsoft.CSharp" />
    <Reference Include="System.Data" />
    <Reference Include="System.Net.Http" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <ItemGroup>
    <None Include="App.config" />
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>


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

namespace CodeForces
{
    class Program
    {
        static void Main()
        {
            var readLine = Console.ReadLine();
            long k = 0;
            if (readLine != null)
            {
                var parameters = readLine.Split(' ').Select(long.Parse);
                var enumerable = parameters as IList<long> ?? parameters.ToList();
                k = enumerable.Last();
            }
            readLine = Console.ReadLine();
            List<long> balls = null;
            if (readLine != null)
            {
                balls = readLine.Split(' ').Select(long.Parse).ToList();
            }
            if (balls != null)
            {
                var kball = balls[k];
                long counter = balls.Count(ball => ball >= kball && ball > 0);
                Console.WriteLine(counter);
            }

        }
    }
}


using System;

public class Class1
{
    static public void Main()
    {
        string[] nk = Console.ReadLine();
        int n = int.Parse(nk[0]);
        int k = int.Parse(nk[1]);
        string[] tok = Console.ReadLine();
        int[] A;
        for (int i = 0; i < n; i++)
            A[i] = int.Parse(tok[i]);
        int ans = 0;
        for (int i = 0; i < n; i++)
            if (A[i] > k) ans++;
        Console.WriteLine(ans);
    }
}


using System;
namespace NextRound
{
    class Next
    {
        static void Main()
        {
            int A,B,C,F;
            A = Console.ReadLine();
            B = Console.ReadLine();
            for(int i = 1;i < A + 1;i++)
            {
                C = Console.ReadLine();
                if(C > B || C = B)
                {
                    F++;
                }
                i = A;
            }
            Console.WriteLine(F.ToString());
        }
    }
}


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

/**
 * Auto-generated code below aims at helping you parse
 * the standard input according to the problem statement.
 **/
class Solution
{
    static void Main(string[] args)
    {
        string[] Numbers = Console.ReadLine().Split(' ');
        int N = int.Parse(Numbers[0]);
        int K = int.Parse(Numbers[1]);
        string[] Scores = Console.ReadLine().Split(' ');
        int count = 0;
        for(int i = 0 ; i < N ; i++){
            int score = int.Parse(Scores[i]);
            if(score < K)
                break;
            count++;
        }
        Console.WriteLine(score);
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//coding by clark wagdy
namespace Spreadsheets
{
    class Program
    {
        static void Main(string[] args)
        {
             int count = 0;
            string line1 = Console.ReadLine();
            string line2 = Console.ReadLine();
            int[] arr = new int[Convert.ToInt32(line1[0])];
            string[] sline = line2.Split(' ');
            for (int i = 0; i < Convert.ToInt32(line1[0]); i++)
            {
                arr[i] = Convert.ToInt32(sline[i]);
            }
            for (int j = 0; j < Convert.ToInt32(line1[0]); j++)
            {
                if (arr[j]> (Convert.ToInt32(line1[2])))
                {
                    count++;
                }
            }
            Console.WriteLine(count);
}

    }


static void Main(string[] args)
        {
            //reading the input data
            System.IO.StreamReader ip = new System.IO.StreamReader("input.txt");
            String s = ip.ReadLine();
            String[] ss = s.Split(' ');
            int  n = Convert.ToInt32(ss[0]);
            int k = Convert.ToInt32(ss[1]);
            int counter = 0;

            s = ip.ReadLine();
            ss = s.Split(' ');
            for (int i = 0; i < n; i++)
            {
                if (Convert.ToInt32(ss[i]) > k)
                    counter++;
            }

            //System.Console.WriteLine(counter);
            System.IO.StreamWriter op = new System.IO.StreamWriter("output.txt");
            op.WriteLine(counter);
            ip.Close();
            ip.Dispose();
            op.Close();
            op.Dispose();

        }


using System;
using System.Drawing;
using System.Runtime.CompilerServices;
using System.Threading;

namespace A._Next_Round
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = Console.ReadLine();
            var n_data = n.Split(' ');

            var participents = int.Parse(n_data[0]);
            var min = int.Parse(n_data[1]);
            int[] point = new int[participents];
            int count,sum=0;

            for(int i =0; i< participents;i++)
            {
                count = 0;

                point[i] = int.Parse(Console.ReadLine());

                if(point[i] > min)
                {
                    count = 1;
                }
                sum = sum + count;
            }

            Console.WriteLine(sum);

        }
    }
}


using System;

class Program
{
	static void Main(string[] args)
	{
		int count1=0;
		string []tmp1 = Console.ReadLine().Split(' ');
     	string []tmp2 = Console.ReadLine().Split(' ');

		for (int i=0;i<int.Parse(tmp1[0]);i++)
		{

		    if(int.Parse(tmp2[i])>int.Parse(tmp1[1]))
		    count1++;
		    else
		    {
		    break;
		    }
		}
		if(count==0)
		{
		     if(int.Parse(tmp2[0])==int.Parse(tmp1[1]))
		    { count1++;
		      for (int i=1;i<int.Parse(tmp1[0]);i++)
		       if(int.Parse(tmp2[0])==int.Parse(tmp1[i]))
		       count1++;
		       else
		       break;

		    }

		}

		Console.WriteLine(count1);
	}
}


using System;

public class Class1
{
    static public void Main()
    {
        string[] nk = Console.ReadLine().Split(' ');
        int n = int.Parse(nk[0]);
        int k = int.Parse(nk[1]);
        string[] tok = Console.ReadLine().Split(' ');
        int [] A=new int [n];
        for (int i = 0; i < n; i++)
            A[i] = int.Parse(tok[i]);
        for(int i=0;i<n;i++)
            for(int j=i+1;j<n;j++)
                if (A[i] < A[j])
                {
                    int tmp = A[i];
                    A[i] = A[j];
                    A[j] = tmp;
                }
        int s = A[k-1];
        int ans = 0;
        for (int i = 0; i < n; i++)
            if (A[i] > s&&A[i]) ans++;
        Console.WriteLine(ans);
    }
}


using System;

public class Class1
{
    static public void Main()
    {
        string[] nk = Console.ReadLine().Split(' ');
        int n = int.Parse(nk[0]);
        int k = int.Parse(nk[1]);
        string[] tok = Console.ReadLine().Split(' ');
        int[] A;
        for (int i = 0; i < n; i++)
            A[i] = int.Parse(tok[i]);
        int ans = 0;
        for (int i = 0; i < n; i++)
            if (A[i] > k) ans++;
        Console.WriteLine(ans);
    }
}


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

namespace ConsoleApp1
{
	class Program
	{
		static void Main()
		{
			int counter = 0;
			string spliting;
			spliting = Console.ReadLine();
			string[] inp = (spliting.Split(new Char [] { ' ' }));
			string[] input = (Console.ReadLine()).Split(new Char [] {' '});
			for(int i = 0; i < int.Parse(inp[0]); ++i)
			{
				if (int.Parse(input[i]) >= int.Parse(input[int.Parse(inp[1])] - 1) && int.Parse(input[i]) > 0)
				{
					counter++;
				}
			}
			Console.WriteLine(counter);
		}
	}
}


#include <iostream>
int main();
{
    int A,B,C,F = 0;
    cin>>A;
    cin>>B;
    for(int i = 1;i < A + 1;i++)
    {
        cin>>C;
        if(C > B || C == B)
        {
            F++;
        }
        i = A;
    }
    cout<<F;
}


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

/**
 * Auto-generated code below aims at helping you parse
 * the standard input according to the problem statement.
 **/
class Solution
{
    static void Main(string[] args)
    {
        string[] Numbers = Console.ReadLine().Split(' ');
        int N = int.Parse(Numbers[0]);
        int K = int.Parse(Numbers[1]);
        string[] Scores = Console.ReadLine().Split(' ');
        int count = 0;
        for(int i = 0 ; i < N ; i++){
            int score = int.Parse(Scores[i]);
            if(score < k)
                break;
            count++;
        }
        Console.WriteLine(score);
    }
}


using System;

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

            int n = int.Parse(s[0]);
            int k = int.Parse(s[1]);

            int[] points = parse(System.Console.In.ReadLine());
            int good_point = points[k - 1];
            int count = 0;

            if (!((n < 1) | (n > k) | (k > 50))) {
                if ((points[count] < 0) | (points[count] > 100)) {
                    count = 0;
                    break;
                }
                while ((points[count] >= good_point) & (points[count] > 0)) count++;
            }

            System.Console.Out.Write(count);
        }

        private static int[] parse(String s)
        {
            string[] strings = s.Split();
            int[] result = new int[strings.Length];
            for (int i = 0; i < strings.Length; i++) result[i] = int.Parse(strings[i]);

            return result;
        }

    }
}


using System;

namespace CodeForces
{
    class A158
    {
        static void Main()
        {
            string[] inputString = Console.ReadLine().Split(' ');
            int n = int.Parse(inputString[0]);
            int failPoint = int.Parse(inputString[1]);

			inputString = new string[n];
			inputString = Console.ReadLine().Split(' ');
			int[] competitors = new int[n];

			int counter = 0;

			foreach(string i in inputString)
			{
				competitors[counter] = int.Parse(i);
				counter++;
			}

			int pass = 0;

            foreach(int i in competitors)
			{
				if(i > failPoint)
				{
					pass++;
				}
			}

			if(pass == 0 && COMPETITORS[0] != 0)
			{
				pass = n;
			}

			Console.WriteLine(pass);
        }
    }
}


using System;

namespace Practice
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] inputs = GetInts();
            int[] prizes = GetInts();
            Console.WriteLine((Array.IndexOf(prizes, inputs[1])));
            Cosole.ReadLine();
        }

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] a = Console.ReadLine().Split(' ');
            string[] s = Console.ReadLine().Split(' ');
            int n=0;
            for(int i=0;i<int.Parse(a[0];i++)
                if(int.Parse(s[i])>int.Parse(a[1]))
                    n++;
            Console.WriteLine(n);

        }
    }
}


using System;

class Program
{
    static void Main(string[] args)
    {
        string[] line = Console.ReadLine().Split();
        int n = int.Parse(line[0]);
        int k = int.Parse(line[1]);
        string[] scores = Console.ReadLine().Split();
        int count = 0;
        for (int i = 0, last = 0; i < n; i++)
        {
            int a_i = int.Parse(scores[i]);
            if((a_i > 0 && i < k) || (i >= k && last == a_i)))
                count++;
            last = a_i;
        }
        Console.WriteLine(count);
    }
}


using System;

class Program
{
	static void Main(string[] args)
	{
		int count1=0;
		string []tmp1 = Console.ReadLine().Split(' ');
     	string []tmp2 = Console.ReadLine().Split(' ');

		for (int i=0;i<tmp1[0];++)
		{
		    if(tmp2[i]>tmp1[1])
		    count1++;
		    else
		    break;
		}

		Console.WriteLine(count1);
	}
}


class P_158A
    {
        static void Main(string[] args)
        {
            String[] paramz = Console.ReadLine().Split(' ');
            int n = Convert.ToInt16(paramz[0]);
            int ptctr = Convert.ToInt16(paramz[1]) - 1;

            String[] input = Console.ReadLine().Split(' ');

            if (Convert.ToInt16(input[ptctr]) != 0)
            {
                while (ptctr < n)
                {
                    if (Convert.ToInt16(input[ptctr + 1]) == Convert.ToInt16(input[ptctr]))
                    {
                        ptctr++;
                    }
                    else
                        break;
                }
            }
            else
            {
                while (ptctr >= 0)
                {
                    if (Convert.ToInt16(input[ptctr]) == 0)
                    {
                        ptctr--;
                    }
                    else
                    {
                        break;
                    }
                }
            }

            Console.Write(ptctr + 1);
        }

    }


using System;

class Program
{
	static void Main(string[] args)
	{
		int count=0;
		int k=0;
		string []tmp1 = Console.ReadLine().Split(' ');
     	string []tmp2 = Console.ReadLine().Split(' ');

		if(int.Parse(tmp2[0])!=0)
		for (int i=0;i<int.Parse(tmp1[0]);i++)
		{

		    if(int.Parse(tmp2[i])>int.Parse(tmp1[1]))
		    {
		    count1++;
		    k++;
		    }
		    else
		    break;

		}

		while(count<int.Parse(tmp1[1])&& k<int.Parse(tmp1[0])&& 0<int.Parse(tmp2[k]))
		{
		    count++;
		    k++;

	    }

	    if(count>int.Parse(tmp1[1]) && k<int.Parse(tmp1[0])&& 0<int.Parse(tmp2[k]))
	    {
	        for (int i=k+1;i<int.Parse(tmp1[0]);i++)
		     {

		        if(int.Parse(tmp2[k])==int.Parse(tmp2[i]))
		       { count++;
		       k++;
		       }
		         else
		         {
		         break;
		         }
      }

		Console.WriteLine(count);
	}
}
}


string s = Console.ReadLine();
            string[] s1 = s.Split();
            s = Console.ReadLine();
            string[] s2 = s.Split();
            int[] n = new int[2];

            int j = 0, c = 0;
            foreach (var i in s1)
            {
                n[j] = Convert.ToInt32(i);
                j++;
            }
            j = 0;
            int[] n1 = new int[n[0]];
            foreach(var i in s2)
            {
                n1[j] = Convert.ToInt32(i);
                j++;
            }
            for(int i = 0; i < n[0]; i++)
            {
                if (n1[i] > (n[1])) c++;
            }
            Console.WriteLine(c);


using System;
namespace NextRound
{
    class Next
    {
        static void main()
        {

        }
    }
}


using System;
using System.Linq;
class Task
{
    static void Main()
    {
        String[] arr=Console.ReadLine().Split(' ');
        int n=int.Parse(arr[0]);
        int k=int.Parse(arr[1]);
        int ne[n];
        int c=0;
        for(int i=0;i<n;i++)
        {
            ne[i]=int.Parse(Console.ReadLine());
        }

        for(int i=0;i<n;i++)
        {
            if(ne[i]>k && ne[i]>=0)
            {
                c++;
            }
        }
        Console.WriteLine(c);

    }

}


using System;
using System.Linq;

class Problem
{
    public static void Main()
    {
        int nk[] = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        int n = nk[0];
        int k = nk[1];

        int[] scores = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        int kScore = scores[k - 1];

        for (int i = 0; i < scores.Length; i++)
        {
            if (scores[i] < kScore)
            {
                Console.WriteLine(i);
                return;
            }
        }
    }
}


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

namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {
            var line1 = Console.ReadLine().Split(' ');
            var line2 = Console.ReadLine().Split(' ');

            int n = int.Parse(line1[0]), k = int.Parse(line1[1]);
            var scores = line2.Select(int.Parse).ToArray();

            for (var cur = scores[k - 1]; k < scores.Length && scores[k] <= 0; k++)
            {
                if (scores[k] != cur)
                {
                    break;
                }
            }

            Console.WriteLine(Math.Max(k - scores.Count(_ => _ >= 0), 0));
        }
    }
}


using System;

namespace Practice
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] inputs = GetInts();
            int[] prizes = GetInts();
            Console.WriteLine((Array.IndexOf(prizes, inputs[1])));
        }

    }

}


using System;

namespace A_NextRound
{
    class Program
    {
        static void Main(string[] args)
        {
            string participants = Console.ReadLine();
            int nParticipants = int.Parse(participants[0].ToString());
            int place = int.Parse(participants[2].ToString());

            string scoreString = Console.ReadLine();
            string[] scores = scoreString.Split(" ");
            int c = 0;
            for(int i = 0; i < scores.Length; i++)
            {
                if(int.Parse(scores[i].ToString()) >= int.Parse(scores[place].ToString()) && int.Parse(scores[i].ToString()) > 0)
                {
                    c++;
                }
            }
            Console.WriteLine(c);
            Console.Read();
        }
    }
}


public static void Main (string[] args)
        {
            int n,k,end=0;
            String[] temp = Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
            String[] main = Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);

            n=Int32.Parse(temp[0]);
            k=Int32.Parse(temp[1]);

            if (n!=0)
            {

            int [] mass=new int[n];

            for (int i=0;i<n;i++)
            {
                mass[i]= Int32.Parse (main[i]);
            }

            for (int i=0;i<n;i++)
            {
                if ((mass[i]<=k))
                {
                    end=i;
                    break;
                }
            }
            if (end==0 & mass[0]>k)
            {end = 1;}

            }

            Console.WriteLine(end);

        }


using System;

class advance {
	static int Win(int k, int[] ptcpts) {
		if (ptcpts[k] == 0) {
			for (int i = k; i >= 0; --i) {
				if(b[i] != 0) return i + 1;
			}
			return 0;
		}
		else {
   			for (int i = k; i < ptcpts.Length; ++i) {
				if (b[i] != ptcpts[k]) return i + 1;
			}
			return ptcpts.Length;
		}
	}

	public static void Main() {
		var a = Console.ReadLine().Split();
		var k = int.Parse(a[1]) - 1;
		var ptcpts = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
		Console.WriteLine(Win(k, ptcpts));
	}
}


using System;

class Program
{
	static void Main(string[] args)
	{
		int count1=0;
		int k=0;
		string []tmp1 = Console.ReadLine().Split(' ');
     	string []tmp2 = Console.ReadLine().Split(' ');

		if(int.Parse(tmp2[0])!=0)
		for (int i=0;i<int.Parse(tmp1[0]);i++)
		{

		    if(int.Parse(tmp2[i])>int.Parse(tmp1[1]) && count1<int.Parse(tmp1[1]))
		    {count1++;

		    k++;
		    for (int i=k;i<int.Parse(tmp1[0]);i++)
		     {

		        if( 0<int.Parse(tmp2[k]) && int.Parse(tmp2[k])==int.Parse(tmp2[i]))
		        count1++;
		         else
		         {k=i;
		         break;
		         }
		     }
		    }
		    else
		    break;

		}

		while(count1<int.Parse(tmp1[1])&& k<int.Parse(tmp1[0])&& 0<int.Parse(tmp2[k]))
		{
		    count1++;
		    k++;

		     for (int i=k;i<int.Parse(tmp1[0]);i++)
		     {

		        if( 0<int.Parse(tmp2[k]) && int.Parse(tmp2[k])==int.Parse(tmp2[i]))
		        count1++;
		         else
		         {k=i;
		         break;
		         }
		     }
		}

		Console.WriteLine(count1);
	}
}


using System;
using System.Linq;

class Program
{
public static void Main(string[] args)
{
var ll = Console.ReadLine().Split(' ');
var k = ll[0];
var str = Console.ReadLine().Split(' ').Select(p => int.Parse(p)).ToList();
Console.WriteLine(str.Count(p => p >= k)) ;
}
}


using System;

namespace ConsoleApplication5
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');
            int n = Int32.Parse(input[0]);
            int k = Int32.Parse(input[1]) - 1;
            input = Console.ReadLine().Split(' ');
            int[] marks = new int[n];

            for (int i = 0; i < n; i++)
                marks[i] = Int32.Parse(input[i]);

            int count = 0;
            if (marks[k] > 0)
                foreach (int m in marks)
                    if (m >= marks[k])
                        count++;
            Console.WriteLine(count);
            Console.ReadKey();
        }
    }


using System;

class Program
{
	static void Main(string[] args)
	{
		int count1=0;
		int k=0;
		string []tmp1 = Console.ReadLine().Split(' ');
     	string []tmp2 = Console.ReadLine().Split(' ');
		bool flag=true;
		if(int.Parse(tmp2[0])!=0)
		for (int i=0;i<int.Parse(tmp1[0]);i++)
		{

		    if(int.Parse(tmp2[i])>int.Parse(tmp1[1]))
		    {count1++;
		    k++;
		    }
		    else
		    break;

		}

		while(count1<int.Parse(tmp1[1])&& k<int.Parse(tmp1[0])&& 0<int.Parse(tmp2[k]))
		{
		    count1++;
		    k++;

		 if( 0<int.Parse(tmp2[0] &&int.Parse(tmp2[0]==int.Parse(tmp2[1]) && flag=true )
		{ count1++;
		 flag=false;
		}
		     for (int i=k+1;i<int.Parse(tmp1[0]);i++)
		     {

		        if( 0<int.Parse(tmp2[k]) && int.Parse(tmp2[k])==int.Parse(tmp2[i]))
		        {
		        count1++;
		        }
		         else
		         {k=i;
		         break;
		         }
		     }
		}

		Console.WriteLine(count1);
	}
}


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

namespace CSharp_Shell
{

    public static class Program
    {
        public static void Main()
        {
        	 string[] nk = Console.ReadLine().Split(" ");
        	 string[] arr = Console.ReadLine().Split(" ");
           int n = Int16.Parse(nk[0]);
           int k = Int16.Parse(nk[1]);
           int r = 0;
           for(int i =0; i< n; i++){
           	int v = Int16.Parse(arr[i]);
           	if(k == v){
           		r = i;
           		break;
           	}
           }
           Console.WriteLine(r);
        }
    }
}


using System;
using System.Security.Cryptography;

namespace ConsoleApp1
{

    class Program
    {

        static void Main(string[] args)
        {

            string nik = Console.ReadLine();
            string participants;

            int[] tab = Array.ConvertAll(nik.Split(" "), int.Parse);

            int n = tab[0];
            int k = tab[1];
            int nextRound = 0;

            participants = Console.ReadLine();

            int[] tabForParticipants = Array.ConvertAll(participants.Split(" "), int.Parse);

            for (int i = 0; i < n; i++)
            {
                if (k < tabForParticipants[i])
                {
                    nextRound++;
                }
            }

            Console.WriteLine(nextRound);

        }
    }
}


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

namespace ConsoleApp3
{
    class Program
    {
        static void Main(string[] args)
        {
            //string test = Console.ReadLine();
            //if (Convert.ToInt32(test)%2 == 0 && Convert.ToInt32(test) != 2)
            //{
            //    Console.WriteLine("YES");
            //}
            //else
            //{
            //    Console.WriteLine("NO");
            //}
            //int numberOfWords = Convert.ToInt32(Console.ReadLine());
            //List<string> words = new List<string>();
            //for (int i = 0; i < numberOfWords; i++)
            //{
            //    words.Add(Console.ReadLine());
            //}

            string input = Console.ReadLine();
            string[] numberOfWords = input.Split(" ");

            int numberOfInput = Convert.ToInt32(numberOfWords[0]);
            int nbWords = Convert.ToInt32(numberOfWords[1]);
            int cpt = 0;

            List<string> words = new List<string>();
                words.Add(Console.ReadLine());

            if (nbWords > 0 && nbWords < 51)
            {
                foreach (var item in words)
                {
                    string[] tab = item.Split(" ");
                    List<int> listNbc = new List<int>();
                    foreach (var nb in tab)
                    {
                        listNbc.Add(Convert.ToInt32(nb));
                    }
                    for (int i = 0; i < listNbc.Count; i++)
                    {
                        if (Convert.ToInt32(listNbc[(nbWords - 1)]) =< listNbc[i])
                        {
                            cpt++;
                        }
                    }

                }
                Console.WriteLine(cpt);
            }

            //int cpt = 0;
            //int cptSolvedProblems = 0;

            //if (numberOfWords > 0 && numberOfWords < 1001)
            //{

            //    foreach (var item in words)
            //    {
            //        string[] oui = item.Split(" ");
            //        for (int i = 0; i < oui.Length; i++)
            //        {
            //            if (Convert.ToInt32(oui[i]) == 1)
            //                cpt++;
            //        }
            //        if (cpt > 1)
            //        {
            //            cptSolvedProblems++;
            //            cpt = 0;
            //        }
            //        else
            //        {
            //            cpt = 0;
            //        }
            //    }
            //    Console.WriteLine(cptSolvedProblems);
            //}

            //foreach (var item in words)
            //{
            //    if (item.Length > 0 && item.Length < 101)
            //    {
            //        if (item.Length > 10)
            //        {
            //            result = item[0] + Convert.ToString(item.Length - 2) + item[item.Length - 1];
            //            Console.WriteLine(result);
            //        }
            //        else
            //        {
            //            result = item;
            //            Console.WriteLine(result);
            //        }
            //    }
            //}
        }
    }
}


using System;
using System.Linq;
class Task
{
    static void Main()
    {
        var[] arr=Console.ReadLine().Split(' ');
        int n=int.Parse(arr[0]);
        int k=int.Parse(arr[1]);
        int[] ne=new int[n];
        int c=0;
        for(int i=0;i<n;i++)
        {
            ne[i]=int.Parse(Console.ReadLine());
        }

        for(int i=0;i<n;i++)
        {
            if(ne[i]>k && ne[i]>=0)
            {
                c++;
            }
        }
        Console.WriteLine(c);

    }

}


int res=0;
        	var str = Console.ReadLine().Split(' ');
        	int n = Int32.Parse(str[0]);
        	int k = Int32.Parse(str[1]);
        	var score = Console.ReadLine().Split(' ');
        	if(int.Parse(score[k])!=0){

        	   for (int i=0;i<n;i++){

        		  if(int.Parse(score[i])>=int.Parse(score[k-1])){
        		     res = res+1;

        	   	  }
	         //Console.WriteLine(res);
        	   }
        	}
        	else{
        		for (int i=0;i<n;i++){

        		   if(int.Parse(score[i])>int.Parse(score[k-1])){
        		      res = res+1;

        		   }
	         //Console.WriteLine(res);
        	   }
        	}

        	Console.WriteLine(res);
        }


/*8 5
10 9 8 7 7 7 5 5 */
using System;
using System.Linq;
class Task
{
    static void Main()
    {
        var[] arr=Console.ReadLine().Split(' ');
        int n=int.Parse(arr[0]);
        int k=int.Parse(arr[1]);
        int ne[n];
        int c=0;
        for(int i=0;i<n;i++)
        {
            ne[i]=int.Parse(Console.ReadLine());
        }

        for(int i=0;i<n;i++)
        {
            if(ne[i]>k && ne[i]>=0)
            {
                c++;
            }
        }
        Console.WriteLine(c);

    }

}


using System;

class Program
{
	static void Main(string[] args)
	{
		int count=0;
		int k=0;
		string []tmp1 = Console.ReadLine().Split(' ');
     	string []tmp2 = Console.ReadLine().Split(' ');

		if(int.Parse(tmp2[0])!=0)
		for (int i=0;i<int.Parse(tmp1[0]);i++)
		{

		    if(int.Parse(tmp2[i])>int.Parse(tmp1[1]))
		    {
		    count1++;
		    k++;
		    }
		    else
		    break;

		}

		while(count<int.Parse(tmp1[1])&& k<int.Parse(tmp1[0])&& 0<int.Parse(tmp2[k]))
		{
		    count++;
		    k++;

	    }

	    if(count>int.Parse(tmp1[1] && k<int.Parse(tmp1[0])&& 0<int.Parse(tmp2[k]))
	    {
	        for (int i=k+1;i<int.Parse(tmp1[0]);i++)
		     {

		        if(int.Parse(tmp2[k])==int.Parse(tmp2[i]))
		       { count++;
		       k++;
		       }
		         else
		         {
		         break;
		         }
      }

		Console.WriteLine(count);
	}
}


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

/**
 * Auto-generated code below aims at helping you parse
 * the standard input according to the problem statement.
 **/
class Solution
{
    static void Main(string[] args)
    {
        string[] Numbers = Console.ReadLine().Split(" ");
        int N = int.Parse(Numbers[0]);
        int K = int.Parse(Numbers[1]);
        string[] Scores = int.Parse(Console.ReadLine().Split(" "));
        int count = 0;
        for(int i = 0 ; i < N ; i++){
            int score = int.Parse(Scores[i]);
            if(score < k)
                break;
            count++;
        }
        Console.WriteLine(score);
    }


using System;
using static System.Console;
using static System.Convert;

class program
{
     public staic void Main()
     {
          String x = ReadLine();
            String y = ReadLine();

            string[] temp = x.Split(' ');

            int number = ToInt32(temp[0].ToString());
            int th = ToInt32(temp[1].ToString())-1;

            int[] nums = new int[number];

            copy_String_2_Int(nums,y);

            int count = 0;
            for (int i = 0; i < nums.Length; i++)
            {
                if (nums[i] >= nums[th] && nums[i] > 0)
                    count++;
            }
            Console.WriteLine(count);

        public static void copy_String_2_Int( int[] arr1 , string arr2)
        {
            string[] temp = arr2.Split(' ');

            for (int i = 0; i < arr1.Length; i++)
            {
                arr1[i] = ToInt32(temp[i].ToString());
            }
        }

     }
}


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

namespace Test
{
public static class Program
{
    public static void Main()
    {
            string a = Console.ReadLine();
            string b = Console.ReadLine();
            int[] first = a.Split().Select(x => Convert.ToInt32(x)).ToArray();
            int[] second = b.Split().Select(x => int.Parse(x)).ToArray();
            int won = first[1];
            int start = won;
            int limit = second[won - 1];
            for (int i = start; i < second.Length; i++)
            {
                if (limit == 0) { won = 0; break; }
                if (limit == second[i]) { won++; }
                else { break; }
            }
            Console.WriteLine(won);
    }
}
}


using System;
class test
{
    static void Main()
    {
        int num = 0;
        string line1 = Console.ReadLine();
        string line2 = Console.ReadLine();
        string [] list1 = line1.Split();
        string [] list2 = line2.Split();
        int [] listInt1 = new int [ list1.Length ];
        int [] listInt2 = new int [ list2.Length ];

        for(int i = 0 ; i < 2 ; i++)
        {
            listInt1[i] = Int32.Parse(list1[i]);
        }

        for(int i = 0 ; i < list2.Length ; i++)
        {
            listInt2[i] = Int32.Parse(list2[i]);
        }

        Array.Sort(listInt2);

        if(num == -1)
        {
            num = 0;
            Console.WriteLine(num);
        }
        else
        {
            for(int i = 0 ; i< listInt2.Length ; i++)
            {
                if(listInt2[i] > listInt1[1])
                {
                    num++;
                }
            }
            if(num == 0)
            {
                for(int i = 0 ; i< listInt2.Length ; i++)
                {
                    else if(listInt2[i] >= listInt1[1])
                    {
                        num++;
                    }
                }
            }
            if(num == listInt1[0])
            {
                num = 0;
            }
        Console.WriteLine(num);
        }
    }
}


using System;

namespace A_NextRound
{
    class Program
    {
        static void Main(string[] args)
        {
            string participants = Console.ReadLine();
            int nParticipants = int.Parse(participants[0].ToString());
            int place = int.Parse(participants[2].ToString());

            string scoreString = Console.ReadLine();
            string scores = scoreString.Split(" ");
            int c = 0;
            for(int i = 0; i < scores.Length; i++)
            {
                if(int.Parse(scores[i].ToString()) >= int.Parse(scores[place].ToString()) && int.Parse(scores[i].ToString()) > 0)
                {
                    c++;
                }
            }
            Console.WriteLine(c);
            Console.Read();
        }
    }
}


using System;

class Program
{
	static void Main(string[] args)
	{
		int count1=0;
		int k=0;
		string []tmp1 = Console.ReadLine().Split(' ');
     	string []tmp2 = Console.ReadLine().Split(' ');

		if(int.Parse(tmp2[0])!=0)
		for (int i=0;i<int.Parse(tmp1[0]);i++)
		{

		    if(int.Parse(tmp2[i])>int.Parse(tmp1[1]) && count1<int.Parse(tmp1[1]))
		    {count1++;
		    k++;
		    for (int i=k;i<int.Parse(tmp1[0]);i++)
		     {

		        if( 0<int.Parse(tmp2[k]) && int.Parse(tmp2[k])==int.Parse(tmp2[i]))
		        count1++;
		         else
		         {k=i;
		         break;
		         }
		     }
		    }
		    else
		    break;

		}

		while(count1<int.Parse(tmp1[1])&& k<int.Parse(tmp1[0])&& 0<int.Parse(tmp2[k]))
		{
		    count1++;
		    k++;

		     for (int i=k;i<int.Parse(tmp1[0]);i++)
		     {

		        if( 0<int.Parse(tmp2[k]) && int.Parse(tmp2[k])==int.Parse(tmp2[i]))
		        count1++;
		         else
		         {k=i;
		         break;
		         }
		     }
		}

		Console.WriteLine(count1);
	}
}


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

namespace ConsoleApp46
{
     class Program
     {
          static void Main()
          {
                 int k = int.Parse(Console.ReadLine().Split(' ')[1]);

                 List<int> scores = Console.ReadLine().Split(' ').Select(× => int.Parse(×)).ToList();

                 int result = scores.Where(× => scores[k]).Count();

                 Console.WriteLine(result);
          }
     }
}


using System;

namespace A_NextRound
{
    class Program
    {
        static void Main(string[] args)
        {
            string participants = Console.ReadLine();
            int nParticipants = int.Parse(participants[0].ToString());
            int place = int.Parse(participants[2].ToString());

            string scoreString = Console.ReadLine();
            string[] scores = scoreString.Split(' ');
            int c = 0;
            for(int i = 0; i < scores.Length; i++)
            {
                if(int.Parse(scores[i].ToString()) >= int.Parse(scores[place].ToString()) && int.Parse(scores[i].ToString()) > 0)
                {
                    c++;
                }
            }
            Console.WriteLine(c);
            Console.Read();
        }
    }
}
using System;

namespace A_NextRound
{
    class Program
    {
        static void Main(string[] args)
        {
            string participants = Console.ReadLine();
            int nParticipants = int.Parse(participants[0].ToString());
            int place = int.Parse(participants[2].ToString());

            string scoreString = Console.ReadLine();
            string[] scores = scoreString.Split(' ');
            int c = 0;
            for(int i = 0; i < scores.Length; i++)
            {
                if(int.Parse(scores[i].ToString()) >= int.Parse(scores[place].ToString()) && int.Parse(scores[i].ToString()) > 0)
                {
                    c++;
                }
            }
            Console.WriteLine(c);
        }
    }
}


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

namespace Test
{
public static class Program
{
    public static void Main()
    {
            string a = Console.ReadLine();
            string b = Console.ReadLine();
            int[] first = a.Split().Select(x => Convert.ToInt32(x)).ToArray();
            int[] second = b.Split().Select(x => int.Parse(x)).ToArray();
            int won = first[1];
            int start = won;
            int limit = second[won - 1];
            for (int i = start; i < second.Length; i++)
            {
                if (limit == 0) { won = 0; break; }
                if (limit == second[i]) { won++; }
                else { break; }
            }
            Console.WriteLine(won);
    }
}
}


using System;

public class Class1
{
    static public void Main()
    {
        string[] nk = Console.ReadLine().Split(' ');
        int n = int.Parse(nk[0]);
        int k = int.Parse(nk[1]);
        string[] tok = Console.ReadLine().Split(' ');
        int *A= new int [n];
        for (int i = 0; i < n; i++)
            A[i] = int.Parse(tok[i]);
        int ans = 0;
        for (int i = 0; i < n; i++)
            if (A[i] > k) ans++;
        Console.WriteLine(ans);
    }
}


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Следующий раунд", "Следующий раунд\Следующий раунд.csproj", "{F7F7DF74-9174-4300-979D-631577C96354}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU
		Release|Any CPU = Release|Any CPU
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{F7F7DF74-9174-4300-979D-631577C96354}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{F7F7DF74-9174-4300-979D-631577C96354}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{F7F7DF74-9174-4300-979D-631577C96354}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{F7F7DF74-9174-4300-979D-631577C96354}.Release|Any CPU.Build.0 = Release|Any CPU
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
EndGlobal


using System;

class Program
{
	static void Main(string[] args)
	{
		int count1=0;
		int k=0;
		string []tmp1 = Console.ReadLine().Split(' ');
     	string []tmp2 = Console.ReadLine().Split(' ');
		bool flag=true;
		if(int.Parse(tmp2[0])!=0)
		for (int i=0;i<int.Parse(tmp1[0]);i++)
		{

		    if(int.Parse(tmp2[i])>int.Parse(tmp1[1]))
		    {count1++;
		    k++;
		    }
		    else
		    break;

		}

		while(count1<int.Parse(tmp1[1])&& k<int.Parse(tmp1[0])&& 0<int.Parse(tmp2[k]))
		{
		    count1++;
		    k++;

		 if( 0<int.Parse(tmp2[0]) &&int.Parse(tmp2[0])==int.Parse(tmp2[1])&& flag=true )
		{ count1++;
		 flag=false;
		}
		     for (int i=k+1;i<int.Parse(tmp1[0]);i++)
		     {

		        if( 0<int.Parse(tmp2[k]) && int.Parse(tmp2[k])==int.Parse(tmp2[i]))
		        {
		        count1++;
		        }
		         else
		         {k=i;
		         break;
		         }
		     }
		}

		Console.WriteLine(count1);
	}
}


using System;

namespace A_NextRound
{
    class Program
    {
        static void Main(string[] args)
        {
            string participants = Console.ReadLine();
            int nParticipants = int.Parse(participants[0].ToString());
            int place = int.Parse(participants[2].ToString());

            string scoreString = Console.ReadLine();
            var scores = scoreString.Split(" ");
            int c = 0;
            for(int i = 0; i < scores.Length; i++)
            {
                if(int.Parse(scores[i].ToString()) >= int.Parse(scores[place].ToString()) && int.Parse(scores[i].ToString()) > 0)
                {
                    c++;
                }
            }
            Console.WriteLine(c);
            Console.Read();
        }
    }
}


using System;

class Program
{
	static void Main(string[] args)
	{
		int count1=0;
		int k=0;
		string []tmp1 = Console.ReadLine().Split(' ');
     	string []tmp2 = Console.ReadLine().Split(' ');

		if(int.Parse(tmp2[0])!=0)
		for (int j=0;j<int.Parse(tmp1[0]);j++)
		{

		    if(int.Parse(tmp2[j])>int.Parse(tmp1[1]) && count1<int.Parse(tmp1[1]))
		    {count1++;

		    k++;
		    for (int i=k;i<int.Parse(tmp1[0]);i++)
		     {

		        if( 0<int.Parse(tmp2[k]) && int.Parse(tmp2[k])==int.Parse(tmp2[i])&& count1<int.Parse(tmp1[1])
		        count1++;
		         else
		         {k=i;
		         break;
		         }
		     }
		    }
		    else
		    break;

		}

		while(count1<int.Parse(tmp1[1])&& k<int.Parse(tmp1[0])&& 0<int.Parse(tmp2[k]))
		{
		    count1++;
		    k++;

		     for (int i=k;i<int.Parse(tmp1[0]);i++)
		     {

		        if( 0<int.Parse(tmp2[k]) && int.Parse(tmp2[k])==int.Parse(tmp2[i]))
		        count1++;
		         else
		         {k=i;
		         break;
		         }
		     }
		}

		Console.WriteLine(count1);
	}
}


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApplication18", "ConsoleApplication18\ConsoleApplication18.csproj", "{2E20431D-E3F5-4D61-9877-3CA732EC7462}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU
		Release|Any CPU = Release|Any CPU
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{2E20431D-E3F5-4D61-9877-3CA732EC7462}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{2E20431D-E3F5-4D61-9877-3CA732EC7462}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{2E20431D-E3F5-4D61-9877-3CA732EC7462}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{2E20431D-E3F5-4D61-9877-3CA732EC7462}.Release|Any CPU.Build.0 = Release|Any CPU
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
EndGlobal


using System;

namespace JobApplications.Practice
{
    public class Next_Round___158A
    {

        static void NotAMain(string[] args)
        {
            int n, k;

            string kn = Console.ReadLine();
            string[] inputs = kn.Split(' ');
            n = Int32.Parse(inputs[0]);
            k = Int32.Parse(inputs[1]);

            string scores = Console.ReadLine();
            string[] scInputs = scores.Split(' ');
            //Well...

            int[] sc = Array.ConvertAll(scInputs, int.Parse);

            int counter = 0;
            int con = sc[k - 1];
            for (int i = 0; i < n; i++)
            {
                if (sc[i] >= con && sc[i] > 0)
                    counter++;
            }
            Console.WriteLine(counter);

        }
    }
}


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

namespace CodeForcePreparing
{
    class Programm
    {
        static void Main(string[] args)
        {
            char[] Split = { ' ' };
            string input1 = Console.ReadLine();
            string[] input1mass = new string[2];
            input1mass = input1.Split(Split);
            int[] input1massint = new int[2];
            for (int i = 0; i < 2; i++)
            {
                input1massint[i] = Convert.ToInt32(input1mass[i]);
            }
            int n = Convert.ToInt32(input1massint[0]);
            int k = Convert.ToInt32(input1massint[1]);

            string input2 = Console.ReadLine();
            string[] input2mass = new string[n];
            input2mass = input2.Split(Split);
            int[] score = new int[n];
            for (int i = 0; i< n; i++)
            {
                score[i] = Convert.ToInt32(input2mass[i]);
            }

            //*******

            if (k - 1 == 0)
            {
                if (score[k - 1] == 0)
                {
                    Console.WriteLine(0);
                    return;
                }
                else
                {
                    if (k = 1)
                    {
                        Console.WriteLine(1);
                    }
                    while (score[k - 1] == score[k])
                    {
                        k++;
                        if (k == n)
                            break;
                    }
                    Console.WriteLine(k);
                    return;
                }

            }
            else if (k == n)
            {
                if (score[k - 1] == 0)
                {
                    while (k >= 0)
                    {
                        k--;
                        if (score[k - 1] != 0)
                        {
                            Console.WriteLine(k);
                            return;
                        }
                    }
                    Console.WriteLine(0);
                }
                else
                {
                    Console.WriteLine(k);
                    return;
                }
            }
            else
            {
                while (score[k - 1] == 0)
                {
                    k--;
                    if (k - 1 == 0)
                    {
                        Console.WriteLine(0);
                        return;
                    }
                }
                while (score[k - 1] == score[k])
                {
                    k++;
                    if (k == n)
                        break;
                }
                Console.WriteLine(k);
            }
        }
    }
}


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

/**
 * Auto-generated code below aims at helping you parse
 * the standard input according to the problem statement.
 **/
class Solution
{
    static void Main(string[] args)
    {
        string[] Numbers = Console.ReadLine().Split(" ");
        int N = int.Parse(Numbers[0]);
        int K = int.Parse(Numbers[1]);
        string[] Scores = int.Parse(Console.ReadLine().Split(" "));
        int count = 0;
        for(int i = 0 ; i < N ; i++){
            int score = int.Parse(Scores[i]);
            if(score < k)
                break;
            count++;
        }
        Console.WriteLine(score);
    }
}


using System;

class Program
{
	static void Main(string[] args)
	{
		int count1=0;
		int k=0;
		string []tmp1 = Console.ReadLine().Split(' ');
     	string []tmp2 = Console.ReadLine().Split(' ');
		bool flag=true;
		if(int.Parse(tmp2[0])!=0)
		for (int i=0;i<int.Parse(tmp1[0]);i++)
		{

		    if(int.Parse(tmp2[i])>int.Parse(tmp1[1]))
		    {count1++;
		    k++;
		    }
		    else
		    break;

		}

		while(count1<int.Parse(tmp1[1])&& k<int.Parse(tmp1[0])&& 0<int.Parse(tmp2[k]))
		{
		    count1++;
		    k++;

		 if( 0<int.Parse(tmp2[0] &&int.Parse(tmp2[0]==int.Parse(tmp2[1]&& flag=true )
		{ count1++;
		 flag=false;
		}
		     for (int i=k+1;i<int.Parse(tmp1[0]);i++)
		     {

		        if( 0<int.Parse(tmp2[k]) && int.Parse(tmp2[k])==int.Parse(tmp2[i]))
		        {
		        count1++;
		        }
		         else
		         {k=i;
		         break;
		         }
		     }
		}

		Console.WriteLine(count1);
	}
}


using System;

namespace A_NextRound
{
    class Program
    {
        static void Main(string[] args)
        {
            string participants = Console.ReadLine();
            int nParticipants = int.Parse(participants[0].ToString());
            int place = int.Parse(participants[2].ToString());

            string scoreString = Console.ReadLine();
            var scores = scoreString.Split(" ");

            for(int i = 0; i < scores.Length; i++)
            {
                if(int.Parse(scores[i].ToString()) >= int.Parse(scores[place].ToString()))
                {
                    Console.Write(scores[i] + " ");
                }
            }
        }
    }
}


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

namespace ConsoleApplication24
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string s = "";
            for (int i = 0; i < n; i++)
                s += Console.ReadLine();

            HashSet<string> set = new HashSet<string>(s, #10 + #13);
            foreach (var x in set)
                Console.WriteLine(x);

            Console.ReadLine();
        }
    }
}


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

    class Program
    {
        public static void Main(string[] args)
        {
            int k,n;
            int ans = 0;
            String s = Console.ReadLine();
            String [] pervstr = s.Split();
            n = Int32.Parse(pervstr[0]);
            int n2 = Int32.Parse(pervstr[0]);
            k = Int32.Parse(pervstr[1]);
            String s2 = Console.ReadLine();
            String[] vtstroka = s2.Split();
            int min=Int32.Parse(vtstroka[n-1]);
            while (min < Int32.Parse(vtstroka[k-1]))
            {
                ans++;
                min = Int32.Parse(vtstroka[--n]);
            }
            Console.WriteLine(n2-ans);
            Console.ReadLine();
        }


int n,k,end=0;
            String[] temp = Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
            String[] main = Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);

            n=Int32.Parse(temp[0]);
            k=Int32.Parse(temp[1]);

            if (n!=0)
            {

            int [] mass=new int[n];

            for (int i=0;i<n;i++)
            {
                mass[i]= Int32.Parse (main[i]);
            }

            for (int i=0;i<n;i++)
            {
                if ((mass[i]<=k))
                {
                    end=i;
                    break;
                }
            }
            if (end==0 & mass[0]>k)
            {end = 1;}

            }

            Console.WriteLine(end);


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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] n = Console.ReadLine().Split(' ').Select(x => Convert.ToInt32(x)).ToArray();
            int[] m = Console.ReadLine().Split(' ').Select(x1 => Convert.ToInt32(x1)).ToArray();
            int s = 0;
            int a = m[n[1]-1];
            for (int i = 0; i < m.Length; i++)
            {
                if (a == 0)
                {
                    break;
                }
                if (m[i] >= a)
                {
                    s = s + 1;
                }
            }
            Console.WriteLine(s);
        }
    }
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] n = Console.ReadLine().Split(' ').Select(x => Convert.ToInt32(x)).ToArray();
            int[] m = Console.ReadLine().Split(' ').Select(x1 => Convert.ToInt32(x1)).ToArray();
            int s = 0;
            int a = m[n[1]-1];
            for (int i = 0; i < m.Length; i++)
            {
                if (a == 0)
                {
                    break;
                }
                if (m[i] >= a)
                {
                    s = s + 1;
                }
            }
            Console.WriteLine(s);
        }
    }
}


<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{DA5984D2-2812-481D-B3A6-2D1F500AC7CB}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <RootNamespace>prob4_Next_round</RootNamespace>
    <AssemblyName>prob4 Next round</AssemblyName>
    <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
    <Deterministic>true</Deterministic>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Core" />
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Data.DataSetExtensions" />
    <Reference Include="Microsoft.CSharp" />
    <Reference Include="System.Data" />
    <Reference Include="System.Net.Http" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <ItemGroup>
    <None Include="App.config" />
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>


using System;
using static System.Console;
using static System.Convert;
clas program
{
    public static void Main()
    {
            String x = ReadLine();
            String y = ReadLine();

            string[] temp = x.Split(' ');

            int number = ToInt32(temp[0].ToString());
            int th = ToInt32(temp[1].ToString());

            int[] nums = new int[number];

            copy_String_2_Int(nums,y);

            int count = 0;
            for (int i = 0; i < nums.Length; i++)
            {
                if (nums[i] >= nums[th] && nums[i]>0)
                    count++;
            }
            Console.WriteLine(count);
    }

     public static void copy_String_2_Int( int[] arr1 , string arr2)
        {
            string[] temp = arr2.Split(' ');

            for (int i = 0; i < arr1.Length; i++)
            {
                arr1[i] = ToInt32(temp[i].ToString());
            }
        }

}


using System;
using System.Drawing;
using System.Runtime.CompilerServices;
using System.Threading;

namespace A._Next_Round
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = Console.ReadLine();
            var n_data = n.Split(' ');
            var participents = int.Parse(n_data[0]);
            var min = int.Parse(n_data[1]);
            int[] point = new int[participents];
            var points = Console.ReadLine();
            var points_split = points.Split();
            int sum = 0,count;
            for(int i =0;i< participents;i++)
            {

                point[i] = int.Parse(points_split[i]);
            }

            for (int j = 0; j < participents - 1; j++)
            {
                count = 0;
                if(point[j]>min)
                {
                    count = 1;
                }

                sum = sum + count;
            }
            Console.WriteLine(sum);

        }
    }
}


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

namespace Test1
{
    public class Test1
    {
        public static void Main()
        {
            Stopwatch sw = Stopwatch.StartNew();

            string a = Console.ReadLine();
            string b = Console.ReadLine();
            int[] first = a.Split().Select(x => Convert.ToInt32(x)).ToArray();
            int[] second = b.Split().Select(x => int.Parse(x)).ToArray();
            int won = first[1];
            int start = won;
            int limit = second[won - 1];
            for (int i = start; i < second.Length; i++)
            {
                if (limit == 0) { won = 0; break; }
                if (limit == second[i]) { won++; }
                else { break; }
            }
            Console.WriteLine(won);

            sw.Stop();
            TimeSpan elapsedTime = sw.Elapsed;
            Console.WriteLine(elapsedTime);
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
class Program
{
public static void Main(string[] args)
{
var ll = Console.ReadLine().Split(' ');
var k = ll[0];
var str = Console.ReadLine().Split(' ').Select(p => int.Parse(p)).ToList();
Console.WriteLine(str.Count(p => p >= k)) ;
}
}


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

/**
 * Auto-generated code below aims at helping you parse
 * the standard input according to the problem statement.
 **/
class Solution
{
    static void Main(string[] args)
    {
        string[] Numbers = Console.ReadLine().Split(' ');
        int N = int.Parse(Numbers[0]);
        int K = int.Parse(Numbers[1]);
        string[] Scores = Console.ReadLine().Split(' ');
        int count = 0;
        for(int i = 0 ; i < N ; i++){
            int score = int.Parse(Scores[i]);
            if(score >= Scores[K-1] && Scores[K-1] >0 )
                count++;
        }
        Console.WriteLine(count);
    }
}


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

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

           string []input = Console.ReadLine().Split(" ") ;
           int NumberOfParticipants= int.Parse(input[0]);
           int kthPlace= int.Parse(input[1]);

           string [] Scores= Console.ReadLine().Split(" ");

            int totalNumber = 0;
            for (int i = 0; i < Scores.Length; i++)
            {
                if (int.Parse(Scores[i]) > kthPlace)
                    totalNumber++;
            }

            Console.WriteLine(totalNumber);

        }
    }
}


class MainClass
{
    public static void Main(string[] args)
    {
        var nk = (from t in Console.ReadLine().Split(' ') select int.Parse(t)).ToArray();
        var array = (from t in Console.ReadLine().Split(' ') select int.Parse(t)).ToArray();
        int it = 0;
        while (array[it] >= array[nk[1] - 1] && it++ < nk[0]);
        Console.WriteLine(it > 0 ? it - 1 : it);
    }
}


/*8 5
10 9 8 7 7 7 5 5 */
using System;
using System.Linq;
class Task
{
    static void Main()
    {
        var[] arr=Console.ReadLine().Split(' ');
        int n=int.Parse(arr[0]);
        int k=int.Parse(arr[1]);
        int ne[n];
        int c=0;
        for(int i=0;i<n;i++)
        {
            ne[i]=int.Parse(Console.ReadLine());
        }

        for(int i=0;i<n;i++)
        {
            if(ne[i]>k && ne[i]>=0)
            {
                c++;
            }
        }
        Console.WriteLine(c);

    }

}


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

namespace JobApplications.Practice
{
    class Next_Round___158A
    {

        static void Main(string[] args)
        {
            int n, k;

            //if (!Int32.TryParse(Console.ReadLine(), out n))
            //    return;
            //if(!)

            string kn = Console.ReadLine();
            string[] inputs = kn.Split(" ");
            n = Int32.Parse(inputs[0]);
            k = Int32.Parse(inputs[1]);
            if (n < k)
                Console.WriteLine(0);

            string scores = Console.ReadLine();
            string[] scInputs = scores.Split(" ");
            if (scInputs.Length != inputs.Length)
                Console.WriteLine(0);

            int[] sc = Array.ConvertAll(scInputs, int.Parse);

            if (sc[0] <= 0)
                Console.WriteLine(0);

            //int people = 1;
            //int currentScore = sc[0];
            //int place = 1;

            //for(int i=1; i<sc.Length; i++)
            //{
            //    if (!(sc[i] < currentScore))
            //    {
            //        place++;
            //        currentScore = sc[i];
            //    }
            //    people++;

            //    if (place >= k)
            //    {
            //        Console.WriteLine(people);
            //        break;
            //    }
            //}

            int counter = 0;
            int con = sc[k - 1];
            for (int i = 0; i < n; i++)
            {
                if (sc[i] >= con && sc[i] > 0)
                    counter++;
            }
            Console.WriteLine(counter);

        }
    }
}


using System;
using static System.Console;
using static System.Convert;

class program
{
     public static void Main()
     {
          String x = ReadLine();
            String y = ReadLine();

            string[] temp = x.Split(' ');

            int number = ToInt32(temp[0].ToString());
            int th = ToInt32(temp[1].ToString())-1;

            int[] nums = new int[number];

            copy_String_2_Int(nums,y);

            int count = 0;
            for (int i = 0; i < nums.Length; i++)
            {
                if (nums[i] >= nums[th] && nums[i] > 0)
                    count++;
            }
            Console.WriteLine(count);

        public static void copy_String_2_Int( int[] arr1 , string arr2)
        {
            string[] temp = arr2.Split(' ');

            for (int i = 0; i < arr1.Length; i++)
            {
                arr1[i] = ToInt32(temp[i].ToString());
            }
        }

     }
}


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

namespace Test
{
	class MainClass
	{
		public static void Main (string[] args)
		{
			string input = Console.ReadLine();
			int n = int.Parse(input.Split(new String[]{" "}, StringSplitOptions.RemoveEmptyEntries)[0]);
			int k = int.Parse(input.Split(new String[]{" "}, StringSplitOptions.RemoveEmptyEntries)[1]);

			input = Console.ReadLine();

			List<int> a = new List<int>();

			for (int i = 0; i < n; i++)
				a.Add(int.Parse(input.Split(new String[]{" "}, StringSplitOptions.RemoveEmptyEntries)[i]));

			int passingScore = a[k - 1];

			if (k[0] == 0)
			{
				Console.WriteLine(0);
				return;
			}

			Console.WriteLine(a.Count(p => p >= passingScore));
		}
	}
}


using System;
class solution
{
    static void Main(String []args)
    {
        string[] tokens=Console.ReadLine().Split();
        int n=int.Parse(tokens[0]);
        int k=int.Parse(tokens[1]);
        tokens=Console.ReadLine().Split();
        int length=0;
        while(tokens.Length!=0)
        {
            if(int.Parse(tokens[(tokens.Length/2)])>k)
            {
                length+=tokens.Length/2;
                tokens=tokens.Slice((tokens.Length/2+1,tokens.Length);
            }
            else
            {
                tokens=tokens.Slice(0,tokens.Length/2+1);
            }
        }
        Console.WriteLine(length);

    }
}


using System;

class Program
{
	static void Main(string[] args)
	{
		int count=0;
		string []tmp1 = Console.ReadLine().Split(' ');
     	string []tmp2 = Console.ReadLine().Split(' ');

		for (int i=0;i<tmp1[0];++)
		{
		    if(tmp2[i]>tmp1[1])
		    count++;
		    else
		    break;
		}

		Console.WriteLine(count);
	}
}


using System;
class solution
{
    static void Main(String []args)
    {
        string[] tokens=Console.ReadLine().Split();
        int n=int.Parse(tokens[0]);
        int k=int.Parse(tokens[1]);
        tokens=Console.ReadLine().Split();
        int length=0;
        while(tokens.Length!=0)
        {
            if(int.Parse(tokens[(tokens.Length/2)])>k)
            {
                length+=tokens.Length/2;
                tokens=tokens.Slice((tokens.Length/2+1),tokens.Length);
            }
            else
            {
                tokens=tokens.Slice(0,(tokens.Length/2+1));
            }
        }
        Console.WriteLine(length);

    }
}


using System;

class Program
{
	static void Main(string[] args)
	{
		int count1=0;
		string []tmp1 = Console.ReadLine().Split(' ');
     	string []tmp2 = Console.ReadLine().Split(' ');

		for (int i=0;i<int.Parse(tmp1[0]);i++)
		{

		    if(int.Parse(tmp2[i])>int.Parse(tmp1[1]))
		    count1++;
		    else
		    {
		    break;
		    }
		}
		if(count==0)
		{
		     if(int.Parse(tmp2[0])==int.Parse(tmp1[1]))
		    { count++;
		      for (int i=1;i<int.Parse(tmp1[0]);i++)
		       if(int.Parse(tmp2[0])==int.Parse(tmp1[i]))
		       count++;
		       else
		       break;

		    }

		}

		Console.WriteLine(count1);
	}
}


class P_158A
    {
        static void Main(string[] args)
        {
            String[] paramz = Console.ReadLine().Split(' ');
            int n = Convert.ToInt16(paramz[0]);
            int k = Convert.ToInt16(paramz[1]);
            int ptr = k-1;

            String[] input = Console.ReadLine().Split(' ');

            if (Convert.ToInt16(input[k]) > 0)
            {
                while (ptr < n)
                {
                    if (Convert.ToInt16(input[ptr + 1]) == Convert.ToInt16(input[ptr]))
                    {
                        ptr++;
                        k++;
                    }
                    else
                    {
                        break;
                    }
                }
            }
            else
            {
                while (ptr > 0)
                {
                    if (Convert.ToInt16(input[ptr - 1]) == Convert.ToInt16(input[ptr]))
                    {
                        ptr--;
                        k--;
                    }
                    else
                    {
                        k--;
                        break;
                    }
                }
            }

            Console.Write(k);
        }
    }


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

public static class Program
{
    public static void Main()
    {
            string a = Console.ReadLine();
            string b = Console.ReadLine();
            int[] first = a.Split().Select(x => Convert.ToInt32(x)).ToArray();
            int[] second = b.Split().Select(x => int.Parse(x)).ToArray();
            int won = first[1];
            int start = won;
            int limit = second[won - 1];
            for (int i = start; i < second.Length; i++)
            {
                if (limit == 0) { won = 0; break; }
                if (limit == second[i]) { won++; }
                else { break; }
            }
            Console.WriteLine(won);
    }
}


using System;
using System.Linq;
class Program_158A
{
    static void Main()
    {
        int WinPt=0;
        Int16[] a = Array.ConvertAll<string, Int16>(Console.ReadLine().Split(), Int16.Parse);
        Int16[] b = Array.ConvertAll<string, Int16>(Console.ReadLine().Split(), Int16.Parse);
        Array.Sort(b);
        if (a[1] < b.Length) WinPt = b[b.Length - a[1]] < 1 ? 1 : b[b.Length - a[1]];
        Console.WriteLine(b.Count(x => x >= WinPt));
    }
}