# https://atcoder.jp/contests/abc159/tasks/abc159_a
read n m ; n=$((n)) ; m=$((m))
A=()
for ((i = 0; i < n; i++)) ; do
  A+=($((2)))
done
for ((j = 0; j < m; j++)) ; do
  A+=($((1)))
done
ans=$((0))
for ((i = 0; i < ${#A[*]}; i++)) ; do
  for ((j = i+1; j < ${#A[*]}; j++)) ; do
    if [ $(((A[i] + A[j]) % 2)) -eq $((0)) ] ; then
      ans=$((ans+1))
    fi
  done
done
echo $ans
