QOJ.ac

QOJ

実行時間制限: 0.6 s メモリ制限: 128 MB 満点: 100

#10605. Removal

統計

Bajtazar loves to play the following (single-player) game. On a board, all natural numbers from $a$ to $b$ are written, forming the sequence $$a, a + 1, a + 2, \dots, b - 1, b.$$ Then, zero or more moves are performed. In each move, any two numbers currently on the board are chosen, provided that their sum is an even number. These two chosen numbers are then removed from the board. The goal of the game is to remove as many elements as possible. Help Bajtazar determine this number.

Input

The first and only line of input contains two natural numbers $a, b$ ($1 \le a \le b \le 10^{18}$), representing the beginning and the end of the sequence of numbers with which Bajtazar's game begins.

Output

Your program should output exactly one line containing the maximum number of elements of the sequence that can be removed in the manner described above.

Examples

Input 1

3 7

Output 1

4

Note

For the example, one can, for instance, remove the numbers 3 and 5, and then the numbers 4 and 6.

Subtasks

Subtask Constraints Points
1 $a, b \le 10$ 11
2 $a, b \le 1\,000\,000$ 21
3 $a = 1$ 32
4 no additional constraints 36

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.