Module Module1
    Sub Main()
        Dim tmp() As String = Split(Console.ReadLine())
        Dim A As Long = tmp(0)
        Dim B As Long = tmp(1)

        Dim ans As Long = (A - 1) * (B - 1)
        Console.WriteLine(ans)
    End Sub
End Module