#input of int(split by space)
def get_i()
  return gets.chomp.split(" ").map(&:to_i)
end
#input of float(split by space)
def get_f()
  return gets.chomp.split(" ").map(&:to_f)
end
#input of string(split by space)
def get()
  return gets.chomp.split(" ")
end
#input of string(split per one character)
def get_nsp()
  return gets.chomp.split("")
end
#yes or no decision
def yn_judge(bool,y="Yes",n="No")
  return bool ? y : n
end
#create of array
def array(size1,init=nil,size2=-1)
  if size2==-1
      return Array.new(size1){init}
  else
      return Array.new(size2){Array.new(size1){init}}
  end
end

def max(a,b)
    return a>b ? a : b
end

def min(a,b)
    return a>b ? b : a
end

INF=Float::INFINITY

s=get_nsp
k=gets.to_i
N=s.size
ab=("a".."z").to_a
N.times do|i|
    if s[i]!="a" and k>="z".ord-s[i].ord+1
      k-="z".ord-s[i].ord+1
      s[i]="a"
    end
end
if k>0
  s[N-1]=ab[(s[N-1].ord-"a".ord+k)%26]
end
puts s.join("")


require 'pp'

s = gets.chomp!.chars
puts "#{s[0, 4].join} #{s[4..].join}"


s=gets
puts s[0..4]+" "+s[5..11]


#![allow(non_snake_case,unused_imports,dead_code)]
use std::io::Read;
use std::cmp::max;
use std::cmp::min;
use std::str::FromStr;
use std::collections::HashMap;
use std::collections::HashSet;
use std::collections::BinaryHeap;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();
    let mut buf_it = buf.split_whitespace();

    let S = buf_it.next().unwrap();

    println!("{} {}",&S[..4],&S[4..]);
}


#[allow(unused_imports)]
use std::char::*;
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;

#[allow(unused_macros)]
macro_rules! debug {($($a:expr),*) => {println!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);}}
#[allow(unused_macros)]
macro_rules! input { ( source = $ s : expr , $ ( $ r : tt ) * ) => { let mut iter = $ s . split_whitespace ( ) ; let mut next = || { iter . next ( ) . unwrap ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; ( $ ( $ r : tt ) * ) => { let stdin = std :: io :: stdin ( ) ; let mut bytes = std :: io :: Read :: bytes ( std :: io :: BufReader :: new ( stdin . lock ( ) ) ) ; let mut next = move || -> String { bytes . by_ref ( ) . map ( | r | r . unwrap ( ) as char ) . skip_while ( | c | c . is_whitespace ( ) ) . take_while ( | c |! c . is_whitespace ( ) ) . collect ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules! input_inner { ( $ next : expr ) => { } ; ( $ next : expr , ) => { } ; ( $ next : expr , $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let $ var = read_value ! ( $ next , $ t ) ; input_inner ! { $ next $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules! read_value { ( $ next : expr , ( $ ( $ t : tt ) ,* ) ) => { ( $ ( read_value ! ( $ next , $ t ) ) ,* ) } ; ( $ next : expr , [ $ t : tt ; $ len : expr ] ) => { ( 0 ..$ len ) . map ( | _ | read_value ! ( $ next , $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ next : expr , chars ) => { read_value ! ( $ next , String ) . chars ( ) . collect ::< Vec < char >> ( ) } ; ( $ next : expr , usize1 ) => { read_value ! ( $ next , usize ) - 1 } ; ( $ next : expr , $ t : ty ) => { $ next ( ) . parse ::<$ t > ( ) . expect ( "Parse error" ) } ; }

#[derive(PartialEq, PartialOrd)]
pub struct Total<T>(pub T);
impl<T: PartialEq> Eq for Total<T> {}
impl<T: PartialOrd> Ord for Total<T> { fn cmp(&self, other: &Total<T>) -> std::cmp::Ordering { self.0.partial_cmp(&other.0).unwrap() }}

#[allow(dead_code)]
const MAX:usize = 100006;
#[allow(dead_code)]
const INF_U32:u32 = 1 << 31;
#[allow(dead_code)]
const INF_I32:i32 = 1 << 30;
#[allow(dead_code)]
const INF_U64:u64 = 1 << 63;
#[allow(dead_code)]
const INF_I64:i64 = 1 << 62;
#[allow(dead_code)]
const MOD:i64 = 1e9 as i64 + 7;

fn main() {
    input!{s:String};
    println!("{} {}", &s[0..4], &s[4..]);
}


fn read1<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn main() {
    let mut s = read1::<String>().chars().collect::<Vec<char>>();
    s.insert(4, ' ');
    println!("{}", s.iter().map(|&c| c).collect::<String>());
}


fn main() {
proconio::input!{n:usize,x:[usize;n]}
println!("{}",x.iter().enumerate().filter(|&(i,&y)|x[y-1]==i+1).count()/2);
}


fn read1<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn main() {
    let mut s = read1::<String>().chars().collect::<Vec<char>>();
    s.insert(4, ' ');
    println!("{}", s.iter().collect::<String>());
}


let S=readLine()!.characters.map{$0}
print(String(S[0..<4]),String(S[4..<12]))


import Foundation

let a = readLine()
let str = String(UTF8String: a!)!

var mone = 0
var newString = ""
for i in str.characters {
    newString.appendContentsOf(String(i))
    if mone == 3 {
        newString.appendContentsOf(String(" "))
    }
    mone++

}

print(newString.uppercaseString)


let S = Array(readLine()!.characters)
print(String(S[0 ..< 4]) + " " + String(S[4 ..< S.count]))


let S = Array(readLine()!.characters)
String(S[0 ..< 4]) + " " + String(S[4 ..< S.count])


extension String {
    var asciiValue: UInt32 {
        guard let first = characters.first where characters.count == 1 else  { return 0 }
        return first.unicodeScalarsValue!
    }
    func asciiValueAt(pos pos: UInt32) -> UInt32 {
        guard characters.count > 0 && Int(pos) < characters.count else  { return 0 }
        return Array(characters)[Int(pos)].unicodeScalarsValue!
    }
}
extension Character {
    var unicodeScalarsValue: UInt32? {
        return String(self).unicodeScalars.first?.value
    }
}

var ss = Array(readLine()!.characters)
var K = Int(readLine()!)!

for i in 0 ..< ss.count {
    let number = Int(ss[i].unicodeScalarsValue!)
    let to = 123 - number
    if to <= K {
        K -= to
        ss[i] = Character("a")
    }
}

if K == 0 {
    print(String(ss))
} else {
    K %= 26
    let last = ss.count - 1
    let unicodeScalar = UnicodeScalar((Int(ss[last].unicodeScalarsValue!) + K - 97) % 26 + 97)
    ss[last] = Character(unicodeScalar)
    print(String(ss))
}


var s: String = readLine()!
let index = 4
print("\(s.characters.prefix(index)) \(s.characters.suffix(s.characters.count - index))")


function main(input) {
  const result = input.substring(0,4) + " " + input.substring(4)
  console.log(result.trim());
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));


function main(input) {
  console.log(input.substring(0,4) + " " + input.substring(4));
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));


function main(input) {
  let result = "";
  for(let i = 0; i < input.length; i++) {
    if (i === 4) {
      result = result + " ";
    }
  	result = result + input[i];
  }
  console.log(result + "\n");
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));


function main(input) {
  let result = "";
  for(let i = 0; i < input.length; i++) {
    if (i === 4) {
      result = result + " ";
    }
  	result = result + input[i];
  }
  console.log(result);
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));


n, m =map(int, input().split())
print((n-1) * (m-1))


l = list(map(int, input().split()))
print((l[0]-1)*(l[1]-1))


a,b=map(int,input().split())
print((a-1)*(b-1))


x,y = int(input().split())
print((x-1)*(y-1))


n = int(input())
m = int(input())
print((n - 1) * (m - 1))


n, m = [map(int, input().split()) for i in range(2)]
print((n-1)*(m-1))


import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line = br.readLine();
        String[] i = line.split(" ");
        int n = Integer.parseInt(i[0]);
        int m = Integer.parseInt(i[1]);
        int r = (n - 1) * (m - 1);
        System.out.println(r);
    }
}


import java.util.*;
import java.io.*;

class Main{
    public static void main(String[] args){
        FastScanner fsc=new FastScanner();
        System.out.println((fsc.nextInt()-1)*(fsc.nextInt()-1));
        fsc.close();

    }
    static class FastScanner {
        private final InputStream in = System.in;
        private final byte[] buffer = new byte[1024];
        private int ptr = 0;
        private int buflen = 0;
        private boolean hasNextByte(){
            if(ptr<buflen) return true;
            else{
                ptr = 0;
                try{
                    buflen = in.read(buffer);
                }
                catch(IOException e){
                    e.printStackTrace();
                }
                if(buflen<=0) return false;
            }
        return true;
        }
        private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
        private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
        public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
        public String next() {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            int b = readByte();
            while(isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }
        public long nextLong() {
            if (!hasNext()) throw new NoSuchElementException();
            long n = 0;
            boolean minus = false;
            int b = readByte();
            if (b == '-') {
                minus = true;
                b = readByte();
            }
            if (b < '0' || '9' < b) throw new NumberFormatException();
            while(true){
                if ('0' <= b && b <= '9') {
                    n *= 10;
                    n += b - '0';
                }
                else if(b == -1 || !isPrintableChar(b)) return minus ? -n : n;
                else throw new NumberFormatException();
                b = readByte();
            }
        }
        public int nextInt() {
            long nl = nextLong();
            if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
            return (int) nl;
        }
        public double nextDouble() { return Double.parseDouble(next());}
        public void close(){
            try{in.close();}
            catch(IOException e){e.printStackTrace();}
        }
    }
}


import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        PrintWriter out = new PrintWriter(System.out);
        InputStreamScanner in = new InputStreamScanner(System.in);
        new Main().solve(in, out);
        out.flush();
    }

    private void solve(InputStreamScanner in, PrintWriter out) {
        int a = in.nextInt();
        int b = in.nextInt();

        out.println((a - 1) * (b - 1));
    }

    static class InputStreamScanner {

        private InputStream in;

        private byte[] buf = new byte[1024];
        private int len = 0;
        private int off = 0;

        InputStreamScanner(InputStream in)	{
            this.in = in;
        }

        String next() {
            StringBuilder sb = new StringBuilder();
            for (int b = skip(); !isSpace(b);){
                sb.appendCodePoint(b);
                b = read();
            }
            return sb.toString();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        char nextChar() {
            return (char)skip();
        }

        int skip() {
            for (int b; (b = read()) != -1;) {
                if (!isSpace(b)) {
                    return b;
                }
            }
            return -1;
        }

        private boolean isSpace(int c) {
            return c < 33 || c > 126;
        }

        private int read() {
            if (len == -1) {
                throw new InputMismatchException("End of Input");
            }
            if (off >= len){
                off = 0;
                try {
                    len = in.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException(e.getMessage());
                }
                if (len <= 0) {
                    return -1;
                }
            }
            return buf[off++];
        }
    }
}


import java.io.IOException;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException {

		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();
		int m = scan.nextInt();

		int ans;
		int tmp_min = Math.min(n, m);

		int i = tmp_min - 1;

		ans = i * i;

		if (n == m) {

			System.out.println(ans);
		} else {
			System.out.println(ans + (tmp_min - 1));
		}
	}

	//***********************以下共通関数************************************************
	/**
	 * 文字列を反転して返す
	 * @param pStr 文字列
	 * @return 反転した文字列
	 */
	public static String myReverse(String pStr) {
		if (pStr.length() < 1) {
			return "";
		}

		StringBuffer sb = new StringBuffer(pStr);
		return sb.reverse().toString();
	}

	/**
	 * 余りを求める。
	 * @param a
	 * @param b
	 * @return 余り。余りがマイナスの時はプラスで返す。
	 */
	public static long myMod(long a, long b) {
		long ret = 0;

		ret = a % b;

		if (ret < 0) {
			ret += b;
		}

		return ret;
	}

	/**
	 * 乗数を求める ※mod対応
	 * @param kisu 基数
	 * @param josu 乗数
	 * @param primeNumMod_0 法 mod値 使わない場合は「0」
	 * @return
	 */
	public static long myPowWithMod(long kisu, long josu, long primeNumMod_0) {

		long ans = 1;

		//乗数が0の場合→1
		if (josu == 0)
			return 1;

		if (primeNumMod_0 == 0) {
			//modを使わないとき

			while (josu > 0) {

				if (josu % 2 == 0) {
					//累乗が偶数の時

					kisu *= kisu;
					josu = josu / 2;
				} else {
					//累乗が奇数の時
					ans *= kisu;
					josu--;
				}
			}

			return ans;

		} else {
			//modを使うとき

			//初めに桁を落とす
			kisu = myMod(kisu, primeNumMod_0);

			while (josu > 0) {

				if (josu % 2 == 0) {
					//累乗が偶数の時

					kisu *= myMod(kisu, primeNumMod_0);
					josu = josu / 2;

				} else {
					//累乗が奇数の時
					ans *= myMod(kisu, primeNumMod_0);
					josu--;

				}
			}

			return myMod(ans, primeNumMod_0);

		}

	}

}


import java.util.Scanner;

    public class Main {
      public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int X = sc.nextInt();
        int []a = new int[N];

        int migi = 0;
        int hidari = 0;
        for(int i=0; i<M; i++) {
        	 a[i] = sc.nextInt();
        	 	if(a[i]<X) {
        	 		hidari++;
        	 	}else {
        	 		migi++;
         	 }
        }
      System.out.println(Math.min(migi,hidari));
      }
    }


import java.util.*;

public class Main{
      public static void main(String[] args) {
            Scanner sc = new Scanner(System.in);
            int num1 = sc.nextInt();
            int num2 = sc.nextInt();
            System.out.println((num1-1) * (num2-2));
          }
}


#include<cstdio>

using namespace std;

int n,m;

int main () {
	scanf("%d%d", &n, &m);
	printf("%d\n", (n - 1) * (m - 1));
	return 0;
}


#include <cstdio>
using namespace std;
int main()
{
	int n,m;
	scanf("%d%d",&n,&m);n--,m--;
	printf("%d",n * m);
}


#include<stdio.h>
int main(){
	int n,m;
	scanf("%d %d",&n,&m);
	printf("%d\n",(n-1)*(m-1));
}


#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<set>

using namespace std;

int main()
{
	int n, m;
	cin >> n >> m;

	cout >> (n - 1)* (m - 1) << endl;
}


#include<bits/stdc++.h>
using namespace std;

#define ll long long

signed main()
{
  int n,m; cin >> n >> m;
  int ans = 0;
  //ans = (n+1)*(m+1) -(n+m)*2;
  ans = nm-n-m+1;
  cout << ans << "\n";
}


#include<bits/stdc++.h>
using namespace std;

#define ll long long

signed main()
{
  int n,m; cin >> n >> m;
  cout << n*m -(n+m)*2 << "\n";
}


#include<stdio.h>
int main(void) {
	int n;
	int m;
	int sum;
	scanf("%d %d",&n,&m);

	sum = (n - 1)*(m - 1);
	printf("%d\n",sum);
	return 0;
}


#include <stdio.h>

int main(void)
{
    int n, m, i, j;

    scanf("%d %d", &n, &m);

    printf("%d\n", (n - 1) * (m - 1));
}


#include <stdio.h>
static int n, m;
int main(void) {
    scanf("%d%d", &n, &m);
    printf("%d\n", --n * --m);
    return 0;
}


n, m = map(int, input().split())
print(~-n * ~-m)


#include<stdio.h>
int main(void){
  int i;
  char s[101];
  int ct=0;

  for(i=0;i<101;i++){
    s[i]=0;
  }

  for(i=0;i<101;i++){
    scanf("%c",&s[i]);
  }

  for(i=0;i<101;i++){
    if(s[i] != '0')ct++;
    else break;
  }

  printf("%c%d%c\n",s[0],ct-2,s[ct-1]);

  return 0;
}


#include <stdio.h>

int main(void){
 	char data[100];
  	int i;
  	scanf("%s",data);
  	for(i=0; data[i]!='\0'; ++i);
  	printf("%c%d%c",data[0],i-2,data[i-1]);
}


function Main(input){
	// input = inp;
	var tmp = input.split(" ");
	var n = tmp[0];
	var m = tmp[1];
	var number = (n - 1) * (m - 1);
	console.log(number);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


function Main(input) {
  input = input.trim()
  input = input.split(" ").map(Number);
console.log((input[0]-1)*(input[1]-1))
}Main(require("fs").readFileSync("/dev/stdin", "utf8"));


'use strict'

const main = (input) => {
    const n = parseInt(input.split(' ')[0])
    const m = parseInt(input.split(' ')[1])
    console.log((n - 1) * (m - 1))
}

main(require('fs').readFileSync('/dev/stdin', 'utf-8'))


function main(input) {
  const s = input.split('');

  const a = s[0].toString();
  const b = (s.length - 2).toString();
  const c = s[s.length - 1];

  const result = a.toString()+b.toString()+c.toString();

  console.log(result);
}

main(require('fs').readFileSync('/dev/stdin', 'utf-8'));


function main(input) {
  var first = input[0];
  var length = input.length - 2;
  var last = input[input.length - 1];
  console.log(first + length + last);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


function Main(input) {
  input = input.trim()
  input = input.split("").map(String);
  var a = input[0]
console.log(""+a+""+(input.length-2)+""+input[input.length-1]);
}Main(require("fs").readFileSync("/dev/stdin", "utf8"));


package main

// Solution for https://atcoder.jp/contests/abc069/tasks/abc069_a

import (
	"bufio"
	"fmt"
	"io"
	"os"
)

type contest struct {
	in  io.Reader
	out io.Writer
}

func (con *contest) Scan(a ...interface{}) (int, error) {
	return fmt.Fscan(con.in, a...)
}
func (con *contest) Scanln(a ...interface{}) (int, error) {
	return fmt.Fscanln(con.in, a...)
}
func (con *contest) Scanf(f string, a ...interface{}) (int, error) {
	return fmt.Fscanf(con.in, f, a...)
}
func (con *contest) Print(a ...interface{}) (int, error) {
	return fmt.Fprint(con.out, a...)
}
func (con *contest) Println(a ...interface{}) (int, error) {
	return fmt.Fprintln(con.out, a...)
}
func (con *contest) Printf(f string, a ...interface{}) (int, error) {
	return fmt.Fprintf(con.out, f, a...)
}
func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	con := &contest{in: in, out: out}
	con.main()
}

func (con *contest) main() error {
	var n, m int
	con.Scan(&n, &m)
	con.Println((n - 1) * (m - 1))
	return nil
}


package main

import (
  "fmt"
)

func main() {
  var n, m int ; fmt.Scan(&n, &m)
  fmt.Println((n-1) * (m-1))
}


package main

import (
	"fmt"
)

func main() {
	var n, m int
	fmt.Scan(&n, &m)

	fmt.Println(n*m - (n + m - 1))
}


package main

import {
  "fmt";
  "strings";
}

func main() {
  var s string;
  fmt.Scan(&s);

  sLen := len(s)
  fmt.printf("%s%d%s", s[0:1], sLen, s[sLen-1:sLen])
}


n, m = gets.chomp.split(' ').map(&:to_i)
ans = (n-1) * (m-1)
print(ans)


n,m=gets.split.map(&:to_i)
p (n-1)*(m-1)


a, b=gets.split.map &:to_i
p (a-1)*(b-1)


n, m = gets.split.map &:to_i

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


s = gets.chomp
m = s.length - 2
newStr = s[1, m]
newStr = newStr.length
l = s.length - 1
lastStr = s[l, 1]
p "#{s[0, 1]}#{newStr}#{lastStr}"


n, m = gets.chomp.map(&:to_i)
puts (n - 1) * (m - 1)


use std::io::*;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let n: usize = read();
    let m: usize = read();
    println!("{}", (n - 1) * (m - 1));
}


macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};
    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };
    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
       n: u32,
       m: u32,
    }
    println!("{}", (n-1) * (m-1));
}


use std::io;

fn procon_read<T: std::str::FromStr>() ->  Vec<T> {
	let mut buf = String::new();
	io::stdin().read_line(&mut buf).expect("");
	let iter = buf.split_whitespace();
	let mut v: Vec<T> = Vec::new();
	for i in iter {
		v.push(i.parse().ok().unwrap());
	}
	v
}

fn main() {
	let v:Vec<i32> = procon_read();
	let n = v[0];
	let m = v[1];
	println!("{}", (m-1)*(n-1) );
}


#![allow(unused_imports)]
// use itertools::Itertools;
use proconio::{input, marker::*};

fn main() {
    input! {
        n: i8,
        m: i8
    };
    println!("{}", (n - 1) * (m - 1));
}