import Control.Monad
import Data.List

firstBinary :: (Int -> Bool) -> Int -> Int -> Int
firstBinary _ l r | l == r = l
firstBinary f l r = let m = div (l + r) 2 in if f m then firstBinary f l m else firstBinary f (m + 1) r

main = do
    [a, b]  <- map read . words <$> getLine
    print $ (a-1) * (b-1)
