#JSUTFPC2025A. JSUT —— 江苏理工

JSUT —— 江苏理工

Statement

Hello, guys! Welcome to Jiangsu University of Technology.

Attracted by the campus structure, Timothy wishes to conduct research on it. He draws an n×mn\times m grid on the blackboard. The grid consists of n+1n+1 vertical line segments and m+1m+1 horizontal line segments. The vertical line segments intersect the horizontal line segments exactly at (n+1)×(m+1)(n+1)\times(m+1) points, forming n×mn\times m unit squares. We refer to these (n+1)×(m+1)(n+1)\times (m+1) intersection points as "grid points". Please output the number of line segments \ell (not limited to vertical or horizontal line segments) that satisfy the following three conditions:

  • The length is not zero.
  • Both endpoints of \ell are grid points.
  • The midpoint of \ell is also a grid point.

Input

One line contains two integers nn and mm separated by a space (1n,m10001\leqslant n, m\leqslant 1000).

Output

Output an integer representing the number of line segments that satisfy the condition.

Samples

2 3
14
1 1
0