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

Задача 33654. electric train


The cars in the train are numbered with natural numbers, starting from 1 (at the same time, sometimes the cars are numbered from the "head" of the train, and sometimes - from the "tail"; it depends on which direction the train is going). Each car has its number.

Vitya got into the ith car from the head of the train and discovered that his car has the number j. He wants to determine how many cars are in the train. Write a program that will do this or tell you that it can't be done without more information.

Input: The input of the program is two numbers i and j (1 ≤ i  ≤ 1000, 1 ≤ j ≤ 1000) separated by a space.
Output: Print a single number — the number of wagons in the train. If it is impossible to uniquely determine the number of wagons, print  number  0
Examples
# Input Output
1 3 4 6