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 Ruby (2.3.3) (judge verdict: Runtime Error)

n = gets.chomp.to_i

a_flag_count = 0
b_flag_count = 0
a_b_flag_count = 0
count = 0
n.times do |t|
  str = gets.chomp
  count += str.scan(/AB/).size
  a_flag = str[-1] == "A"
  b_flag = str[0] == "B"
  if a_flag && b_flag then
    a_b_flag_count += 1
  elsif a_flag then
    a_flag_count += 1
  elsif b_flag then
    b_flag_count += 1
  end
end

if a_b_flag_count > 0 then
  count += (a_b_flag_count - 1)
  if a_flag_count > 0 then
    count += 1
    a_flag_count -= 1
  end
  if b_flag_count > 0 then
    count += 1
    b_flag_count -= 1
  end
  count += [a_flag_count, b_flag_count].min
else
  count += [a_flag_count, b_flag_count].min
end

puts count