using System; using System.Collections.Generic; using System.IO; using System.Linq; class Solution { static void Main(String[] args) { string[] tokens = Console.ReadLine().Split(' '); int a = Convert.ToInt32(tokens[0]); int b = Convert.ToInt32(tokens[1]); int x = 0; if ((a == 1) && (b == 1)) { x = 0; } else if (a == 1) { x = b - 1; } else if (b == 1) { x = a - 1; } else { x = (a - 1) + (a * (b - 1)); } Console.WriteLine(x); } }