//Enter your code here. Read input from STDIN. Print output to STDOUTmodule console open System open System.IO let rec folds n m = if n = 1 then m - 1 else if m = 1 then n - 1 else 1 + (folds 1 m) + (folds (n - 1) m) [] let main argv = let s = Console.ReadLine() match s.Split() |> Array.map int with | [|n; m|] -> folds n m |> printfn "%d" | _ -> failwith "Invalid input" 0 // return an integer exit code