Олимпиадный тренинг

Задача 33653. Full house!


In one of the popular cinemas, all sessions are sold out, so all seats in the hall are always occupied. Unfortunately, the distance between the rows in the cinema hall is small, and the audience, making their way to their seats before the start of the film, is forced to stumble over the legs of those already seated. Entering the hall, the viewer thinks from which side of the row he will make his way to his place (from the left or from the right), and chooses the side so as to stumble over a smaller number of people. In case of equality, the viewer chooses the side to which his place is closer.

Vasya, an ardent lover of cinema and an equally ardent hater of mathematics, was the first to buy a ticket for the next premiere. When Vasya entered the hall and sat down in his place, he saw that all the other chairs in his row were still empty. Vasya knew for sure that by the beginning of the screening the hall would be filled to capacity, which meant that any minute other film lovers would start stumbling over his feet, making their way to their seats. Despite all his dislike for mathematics, Vasya instantly estimated what the maximum number of people could trip over his feet before all the spectators took their places. Can you?

Input: The program takes as input two integers (one per line) n and k — the number of seats in the row where Vasya is sitting, and the number of his seat, respectively (1≤k≤n≤50, n — even). Seats in a row are numbered from one.

Output: The program should print the maximum number of people who can trip over Vasya's feet.
Examples
# Input Output
1 4
1
1

Запрещенные операторы:max;min