import Control.Applicative

-- | slove
-- >>> solve 3 4
-- 6
-- >>> solve 2 2
-- 1

main = do
    (n : m : _) <- (map read . words) <$> getLine -- input: 123 456 789
    print $ solve n m

solve n m = (n - 1) * (m - 1)
