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 */ int[] nm = Array.ConvertAll(Console.ReadLine().Split(' '), Int32.Parse); long a = nm[0]; long b = nm[1]; if (a > b) { long temp = a; a = b; b = temp; } long result = a-1; result += a*(b-1); Console.WriteLine(result); } }