let readString() = stdin.ReadLine()
let readStringArray() = stdin.ReadLine().Split(' ');
let readInt() = readString() |> int
let readIntArray() = readStringArray() |> Array.map (fun x -> int x)


let n, m = readIntArray() |> fun x -> (x.[0], x.[1])

(n - 1) * (m - 1) 
|> printfn "%d"