Footballers
After Lionel Messi and Cristiano Ronaldo admitted that math isn't their strong suit and found the "Football Products" task challenging, they asked Vasya to create a simpler game for them.
This time, Vasya decided not to overwhelm the footballers with complex tasks (after all, they still have a cup to compete for!), and instead, he came up with a drawing challenge. But it's not just about drawing a field or a ball; they need to draw a polygon that could become a masterpiece of "polygon construction"—a "football polygon."
Lionel and Cristiano were tasked with choosing numbers. Messi chose the number A, and Ronaldo chose B.
The task seemed straightforward until Vasya reminded them that they must draw A points and connect some pairs with segments, ensuring that a B-gon with all its diagonals and sides is not formed. The goal is to maximize the number of segments. Within minutes, both footballers had examples where the maximum was achieved and proof that no more segments could be added.
As the referee, your job is to verify the maximality of the drawn segments.
Input
The input consists of a single line containing two integers, A and B, provided by the footballers, separated by a space.
1 < A, B ≤ 1000.
Output
Output a single integer representing the maximum number of segments that can be drawn under the given conditions.