read n m echo $[n%2*m/4+m%2*n/4+(n%4-3/n+m%4-3/m)/6*2]