import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ Scanner obj = new Scanner(System.in); int n=obj.nextInt(); int m=obj.nextInt(); if(n>1) n=n-1; if(m>1) m=m-1; System.out.println(m*n); } }