module Main where

import Control.Applicative
import Control.Monad

solve :: Int -> Int -> Int
solve a b = (a - 1) * (b - 1)

main :: IO ()
main = do
    [a, b] <- fmap read . words <$> getLine
    print $ solve a b