#0000CD

IntGrid

You are given a triangle with its endpoints (0, 0), (n, m), (n, 0). You have to find the number of integer coordinates (a, b) that are inside the given triangle. If a coordinate is on the triangle edge (side) then we consider that it is inside the triangle.



InputFrom the first line of the standard input read two integers n and m (0 <= n, m <= 1 000 000 000).
30% test cases will have (0 <= n, m <= 1 000).
60% test cases will have (0 <= n, m <= 1 000 000).


OutputTo the standard Output write one integer representing the number of integer points (points with integer coordinates) that are inside the given triangle.


Input:5 3

Output:
13
Objašnjenje:
The points with integer coordinates inside the triangle are:
(0, 0), (1, 0), (2, 0), (3, 0), (4, 0), (5, 0), (2, 1),
(3, 1), (4, 1), (5, 1), (4, 2), (5, 2), (5, 3), .


Input:17 21

Output:
199

Submit solution

Coming later

The grading service will be connected in a later migration step. You can inspect the task and your previous results now.