Problem:
Score : 100 points

Problem Statement

Snuke has N integers: 1,2,\ldots,N.
He will choose K of them and give those to Takahashi.

How many ways are there to choose K consecutive integers?

Constraints

All values in input are integers.

1 \leq K \leq N \leq 50

Input

Input is given from Standard Input in the following format:

N K

Output

Print the answer.

Sample Input 1

3 2

Sample Output 1

2

There are two ways to choose two consecutive integers: (1,2) and (2,3).

Sample Input 2

13 3

Sample Output 2

11

Solution in C# (Mono 4.6.2.0) (judge verdict: Runtime Error)

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());
            string[] s = new string[N];
            int def = 0;
            List<int> abc = new List<int>();
            abc.Add(0); abc.Add(0);
            int c = 0;
            for (int i = 0; i < N; i++)
            {
                s[i] = Console.ReadLine();
                string buf = s[i].Replace("AB", "");
                def += (s[i].Count() - buf.Count()) / 2;
                if(s[i][s[i].Length - 1] =='A')
                {
                    if (s[i][0] == 'B')
                    {
                        c++;
                    }
                    else { abc[0]++; }
                }
                else if(s[i][0] == 'B')
                {
                    abc[1]++;
                }
            }
            //  abc.Sort((a, b) => b - a);
            if (abc[0] > abc[1])
            {
                if (abc[0] >= abc[1] + c)
                {
                    Console.WriteLine(abc[1] + c + def);
                }
                else
                {

                    Console.WriteLine(abc[0] + c + abc[0] - abc[1]+def);
                }
            }
            if(abc[1]>=abc[0])
            {
                if (abc[1] >= abc[0] + c)
                {
                    Console.WriteLine(abc[0] + c + def);
                }
                else
                {

                    Console.WriteLine(abc[1] + c + abc[1] - abc[0]+1+def);
                }
            }

        }
        
    }
}