Number of Regions

Given A and B, count the regions into which the A times B lines y = ax + b with 0 <= a < A, 0 <= b < B divide the plane.

Hard8CombinatoricsGeometryNumber theoryNo attempts yetTime limit2sMemory limit512 MB

Problem

You are given two integers AA and BB. For every integer pair (a,b)(a, b) with 0a<A0 \le a < A and 0b<B0 \le b < B, draw the line y=ax+by = ax + b on the plane. Different pairs give different lines, so A×BA \times B lines are drawn.

Write a program that finds how many regions those lines cut the plane into.

Input

The first line contains AA and BB. (1A,B12001 \le A, B \le 1200)

Output

Print the number of regions on the first line. This value goes past the 32-bit integer range, so use a 64-bit integer type.