A lattice square is a square whose four vertices all lie on lattice points. A lattice point is a point whose x coordinate and y coordinate are both integers. For example, (1,5) is a lattice point and (1,1.5) is not.
An m×n grid is m cells wide and n cells tall. Its lattice points are the integer points (x,y) with 0≤x≤m and 0≤y≤n.
Some lattice squares that fit in the grid have sides parallel to the axes, and others are tilted. If one side of a lattice square is the vector (p,q), the square has area p2+q2, so a tilted square also has an integer area. The square built on (1,2) has area 5, which is odd, and the square built on (1,1) has area 2, which is even.
Given the size of the grid, count the lattice squares that fit in the grid and have odd area.
Two lattice squares are different unless they share all four sides.
The input has at most 50000 lines. Each line contains two integers m and n, the size of the grid (1≤m,n≤100000).
The last line contains two zeros. That line is not processed.
For each grid, print the number of lattice squares with odd area, one per line. The answer always fits in a 64-bit signed integer.