#Lutece1871. 张悦甲与张悦由

张悦甲与张悦由

Migrated from Lutece 1871 张悦甲与张悦由

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

学姐姐张悦中有一天得到了nnmm列个张悦由,有天她惊奇的发现张悦由翻过来就变成了张悦甲张悦甲翻过来就变成了张悦由,于是学姐姐就把所有位置从第一行第一列开始依次翻转(先从左到右,再从下到上)都翻转一遍,但是学姐姐的爪子手太大了,每次翻转都会带动周围的8个张悦由或者张悦甲(如果在边界上可能不足8个),求最后的张悦甲的个数。

注意:空间限制较小,请不要开数组= ̄ω ̄=

Input

输入包括两个数n,m
1n,m300001\le n, m \le 30000

Output

最后的张悦甲的个数

Samples

2 2
0
1 7
5
314 1592
496080
1 1
1

Resources

学姐姐比武招妻