using System; using System.Collections.Generic; using System.IO; class Solution { static void Main(String[] args) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution */ long result = 0; string[] arrS = Console.ReadLine().Split(' '); Int64[] arr = Array.ConvertAll(arrS,Int64.Parse); long rows = arr[0]; long columns = arr[1]; if(rows == 1) result = columns - 1; else if(columns == 1) result = rows - 1; else { long min = Math.Min(rows,columns); result = (min - 1) + (Math.Max(rows,columns) - 1) * min; } Console.WriteLine(result); } }