using System; using System.Collections.Generic; using System.IO; using System.Linq; class Solution { static void Main(String[] args) { string[] tokens_n = Console.ReadLine().Split(' '); long n = Convert.ToInt32(tokens_n[0]); long m = Convert.ToInt32(tokens_n[1]); long min = Math.Min(m, n); long max = Math.Max(m, n); long sum = min - 1 + min * (max - 1); Console.WriteLine(sum); } }