Stepan has fallen in love and wants to impress the girl by gifting her a large box of chocolates. Following his friends' advice, he visits the renowned ShenRo confectionery factory, where he discovers that their large chocolate boxes are triangular in shape. In these boxes, chocolates are arranged in rows: the first row contains one chocolate, the second row contains two, the third row contains three, and so on. The factory offers boxes with any number of rows from to . Stepan plans to purchase one of these boxes. However, there's a catch: his girlfriend will be disappointed if the total number of chocolates in the box isn't divisible by . If it's not divisible, one of her friends might receive more chocolates than the others, or some chocolates might be left over. Therefore, Stepan insists that the total number of chocolates in the box must be divisible by .
When selecting the perfect gift, Stepan encounters the challenge of choosing the right box, as there are numerous options available. Without much deliberation, he decides to seek assistance from the olympiad participants.
Your task is to determine the number of ways Stepan can choose a box of chocolates from the available options, where the number of rows ranges from to , given the integers and . Each way is considered distinct if it corresponds to a box with a different number of rows.
The first line of the input contains two integers: , the maximum number of rows in the chocolate box, and , the number of friends Stepan's girlfriend has (1 \leq N,\ M \leq 2 \cdot 10^9).
The output should be a single integer representing the number of different ways to select a box of chocolates.
Example 1