using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Cutting_Paper_Squares { class Program { static void Main(string[] args) { long[] mXn = Array.ConvertAll(Console.ReadLine().Split(' '), long.Parse); long n = mXn[0]; long m = mXn[1]; long firstCut,secondCut; firstCut = Math.Max(n,m); secondCut= Math.Min(n,m); long res = firstCut - 1 + firstCut * (secondCut - 1); Console.WriteLine(res); } } }