P24989 [AtCoder] [ARC048A] Below the Stairs
入门
题目描述

Problem Description

AtCoder's office building, which has achieved a yearly sales of $10$ billion yen, is an ultra-high-rise building with $10^9$ floors above ground and $10^9$ floors below ground.

The lobby is on the $1$st floor, above which are floors $2, 3, 4, ..., 10^9$, and below which are underground floors $1, 2, ..., 10^9$.

Unfortunately, all the elevators have broken down, so Takahashi decided to climb the stairs from floor $A$ to a higher floor $B$.

There is a staircase between every adjacent pair of floors in AtCoder's office building. Also, Takahashi will not go down the stairs.

How many floors worth of stairs does Takahashi need to climb? For $x > 0$, $-x$ denotes the $x$th underground floor.

Input Format

The input is given from the standard input in the following format:

$ A $ $ B $

  • The first line contains two integers $ A, B (-10^9 ≦ A < B ≦ 10^9) $ separated by a space.

Output Format

Output a single integer representing how many floors worth of stairs Takahashi needs to climb.

Do not forget to add a newline at the end of the output.

Sample Input and Output

Sample Input #1

3 6

Sample Output #1

3

Sample Input #2

-1 1

Sample Output #2

1

Sample Input #3

-7 -2

Sample Output #3

5

Notes/Hints

Sample Explanation 1

Takahashi needs to climb the stairs from the $3$rd floor to the $4$th floor, from the $4$th floor to the $5$th floor, and from the $5$th floor to the $6$th floor.

Sample Explanation 2

The floor above the $1$st underground floor is the $1$st floor above ground.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
3 6
样例输出
3