This time, Vadim decided to try creating his own Sudoku with a different unusual rule. Two numbers are considered an XV-pair if their sum equals either X or V.
Vadim wants to create a sequence of positive integers where every two adjacent numbers form an XV-pair. Since this sequence will be part of his Sudoku, the numbers in it must not repeat. Help him find the maximum number of numbers that can be in this sequence.
Input
The first line contains an integer X (3 ≤ X ≤ 109).
The second line contains an integer V (3 ≤ V ≤ 109).
Output
Output the maximum length of a sequence of distinct positive integers in which every two adjacent numbers form an XV-pair.
Sample
Notes
In the example, a suitable sequence could be [8,2,3,7].
Problem Author: Vadim Barinov
Problem Source: Ural School Programming Contest 2023