jiahuimbzuai/CoQuIR huggingface dataset:
//  [python]
A,B,C = input().split()
array =[A,B,C]

array.sort()

if "5" in array[0]:
    del array[0]
    if "5" in array[0]:
        del array[0]
        if "7" in array[0]:
            print("YES")
        else:
            print("NO")
    else:
        print("NO")
else:
    print("NO")
//  [python]
a, b, c = sorted([int(x) for x in input().split()])
print('YES' if a == b == 5 and c == 7 else 'NO')
//  [java]
import java.io.PrintWriter;
import java.util.Scanner;


public class Main {
	static PrintWriter out = new PrintWriter(System.out);
	public static void main(String[] args) {
		// 入力
		final int[] a = new int[3];
		try(Scanner scan = new Scanner(System.in)) {
			a[0] = scan.nextInt();
			a[1] = scan.nextInt();
			a[2] = scan.nextInt();
		}
		int count5 = 0;
		int count7 = 0;
		
		for (int i = 0; i < 3; i++) {
			if (a[i] == 5) {
				count5++;
			} else if (a[i] == 7) {
				count7++;
			}
		}
		final boolean result = count5 == 2 && count7 == 1;
		
		// 出力
		out.println(result ? "YES" : "NO");
		out.flush();
	}
}
//  [java]
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int num[] = new int[3];

        int c = 0;
        for (int i = 0; i < 3; i++) {
            int n = sc.nextInt();
            if(n > 5) {
                num[2] = n;
            } else {
                num[c++] = n;
            }
        }

        if(num[0] == 5 && num[1] == 5 && num[2] == 7) {
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }

    }
}
//  [java]
import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner sc =new Scanner(System.in);
		int[]a=new int[3];
		int count=0;
		for(int i=0;i<3;i++){
			a[i]=sc.nextInt();
		}
		for(int j=0;j<3;j++){
			if(a[j]==7){
				count++;
			}
		}
		if(count==1){
			System.out.println("YES");
		}else{
			System.out.println("NO");
		}
	}

}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define vvi vector< vector<int> >
#define vi vector<int>
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back
#define pii pair<int,int>
#define mp make_pair
#define pi 3.14159265359
#define shosu(X) fixed << setprecision(X)
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

int main(){
	int a[3];
	REP(i,3) cin >> a[i];
	int num5 = 0;
	int num7 = 0;
	REP(i,3) if(a[i] == 5) num5++;
	REP(i,3) if(a[i] == 7) num7++;
	if(num5 == 2 && num7 == 1) cout << "YES" << endl;
	else cout << "NO" << endl;

}
//  [cpp]
/*
______________________________
                              |
Shubham Singhal               |
                              |
CodeChef          torque      |
HackerEarth       torque      |
SPOJ              torque      |
HackerRank        torquecode  |
CodeForces        torquecode  |
AtCoder           torque            |
______________________________| */


// If Tyrion dies, I am gonna riot :P


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

# define MOD         1000000007
# define gc          getchar
# define LL          long long
# define L           long
# define pb          push_back
# define mp          make_pair
# define vi          vector<int>
# define MAXN        100005
# define INF         1e9



int main()
{

    int a[3],c1=0,c2=0;
    for(int i=0;i<3;i++)
    {
        cin>>a[i];
        if(a[i]==5)
            c1++;
        else if(a[i]==7)
            c2++;
    }
    if(c1==2 && c2==1)
        cout<<"YES\n";
    else
        cout<<"NO\n";

    return 0;
}
//  [cpp]
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
  vector<int> v(3);
  vector<int> expected = { 5, 5, 7 };
  for (auto & n : v) cin >> n;
  sort(v.begin(), v.end());
  if (equal(v.begin(), v.end(), expected.begin())) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}
//  [c]
#include <stdio.h>

int main(){

    int n, i, f_count = 0, s_count = 0;

    for(i = 0; i < 3; i++){
        scanf("%d", &n);

        if(n == 5){
            f_count++;
        }

        if(n == 7){
            s_count++;
        }
    }

    if(f_count ==2 && s_count == 1){
        printf("YES\n");
    }
    else{
        printf("NO\n");
    }

    return 0;
}
//  [c]
#include <stdio.h>
int main(void){
    
    int a,b,c;

    scanf("%d %d %d",&a,&b,&c);
    if(a == 5 && b == 5 && c == 7){
        puts("YES");
    }else if(a == 5 && b == 7 && c == 5){
        puts("YES");
    }else if(a == 7 && b == 5 && c == 5){
        puts("YES");
    }else{
        puts("NO");
    }


    return 0;
}
//  [c]
#include <stdio.h>

int main()
{
	int A, B, C;
	scanf("%d %d %d", &A, &B, &C);
	if (A + B + C == 17 && A * B + B * C + C * A == 95 && A * B * C == 175) printf("YES\n");
	else printf("NO\n");
	fflush(stdout);
	return 0;
}
//  [javascript]
'use strict'
function Main(input) {
  const arr = input.split(" ");
  let count5 = 0, count7 = 0;
  
  arr.forEach(a => {
    if(a == 5){
      count5++;
    }else if(a == 7){
      count7++;
    }
  });

  console.log(count5 === 2 && count7 === 1 ? 'YES' : 'NO');
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
'use strict';

function main(input) {
  const inputs = input.split(' ').map((x) => x | 0);

  const sum = inputs.reduce((a, b) => a + b);
  if (sum != 17) {
    console.log('NO');
    return;
  }

  let i = inputs.shift();
  while (i) {
    if (i != 5 && i != 7) {
      console.log('NO');
      return;
    }
    i = inputs.shift();
  }

  console.log('YES');
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
process.stdin.resume();
process.stdin.setEncoding('utf8');
 
var input_lines = [];
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
 
let count5 = 0; 
  let count7 = 0; 
  let result = 'NO'
reader.on('line', (line) => {
  input_lines = line.split(" ")
  
  for(let i = 0; i < input_lines.length; i++) {
  
    if(input_lines[i] == 5) {
      count5++
    }
    if(input_lines[i] == 7) {
      count7++
    }

   }
  
  if(count7 == 1 && count5 == 2) {
    result = 'YES'
  }
  
});
 
 
/* ーーーー入力ーーーー
ここに書くコードを変える
 
 
　 ーーーー出力ーーーー */
reader.on('close', () => {
  console.log(result);
});
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func Scanner() string {
	sc.Scan()
	return sc.Text()
}

func intScanner() int {
	n, _ := strconv.Atoi(Scanner())
	return n
}

func floatScanner() float64 {
	n, _ := strconv.ParseFloat(Scanner(), 64)
	return n
}
func stringToInt(s string) int {
	n, _ := strconv.Atoi(s)
	return n
}
func stringSliceScanner(n int) []string {
	a := make([]string, n)
	for i := 0; i < n; i++ {
		a[i] = Scanner()
	}
	return a
}
func intSliceScanner(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = intScanner()
	}
	return a
}
func larger(a, b int) int {
	if a < b {
		return b
	} else {
		return a
	}
}
func smaller(a, b int) int {
	if a > b {
		return b
	} else {
		return a
	}
}
func max(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x < a[i] {
			x = a[i]
		}
	}
	return x
}
func min(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x > a[i] {
			x = a[i]
		}
	}
	return x
}
func abs(x int) int {
	if x < 0 {
		x = -x
	}
	return x
}

var mod int = 1000000007

func main() {
	buf := make([]byte, 0)
	sc.Buffer(buf, mod)
	sc.Split(bufio.ScanWords)
	a := intSliceScanner(3)
	sort.Ints(a)
	if a[0] == a[1] && a[0] == 5 && a[2] == 7 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}
//  [go]
package main

import "fmt"

func main() {
	// Code for A - Iroha and Haiku (ABC Edition)
	var A, B, C int
	fmt.Scanf("%d %d %d", &A, &B, &C)

	if (A == 5 && B == 5 && C == 7) || (A == 5 && B == 7 && C == 5) || (A == 7 && B == 5 && C == 5) {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}
//  [ruby]
def check_575(array)
  appear_count_5, appear_count_7 = 0, 0

  array.each do |s|
    appear_count_5 += 1 if s == '5'
    appear_count_7 += 1 if s == '7'
  end

  appear_count_5 == 2 && appear_count_7 == 1
end

puts check_575(gets.split) ? 'YES' : 'NO'
//  [ruby]
class A042
  def call(a, b, c)
    (a == 5 || a== 7) &&
        (b == 5 || b== 7) &&
        (c == 5 || c== 7) &&
        a + b + c == 17
  end

  def main
    inputs = gets.split(' ')
    if call(inputs[0].to_i, inputs[1].to_i, inputs[2].to_i)
      puts 'YES'
    else
      puts 'NO'
    end
  end
end

A042.new.main
//  [ruby]
arr = {}
gets.split(" ").map(&:to_i).each do |i|
  arr[i] ||= 0
  arr[i] += 1
end

puts arr[5] == 2 && arr[7] == 1 ? "YES" : "NO"
//  [rust]
/// https://github.com/hatoo/competitive-rust-snippets
#[allow(unused_imports)]
use std::cmp::{max, min, Ordering};
#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
#[allow(unused_imports)]
use std::io::{stdin, stdout, BufWriter, Write};
#[allow(unused_imports)]
use std::iter::FromIterator;
mod util {
    use std::fmt::Debug;
    use std::io::{stdin, stdout, BufWriter, StdoutLock};
    use std::str::FromStr;
    #[allow(dead_code)]
    pub fn line() -> String {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        line.trim().to_string()
    }
    #[allow(dead_code)]
    pub fn chars() -> Vec<char> {
        line().chars().collect()
    }
    #[allow(dead_code)]
    pub fn gets<T: FromStr>() -> Vec<T>
    where
        <T as FromStr>::Err: Debug,
    {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        line.split_whitespace()
            .map(|t| t.parse().unwrap())
            .collect()
    }
    #[allow(dead_code)]
    pub fn with_bufwriter<F: FnOnce(BufWriter<StdoutLock>) -> ()>(f: F) {
        let out = stdout();
        let writer = BufWriter::new(out.lock());
        f(writer)
    }
}
#[allow(unused_macros)]
macro_rules !get {([$t:ty]) => {{let mut line: String = String::new(); stdin().read_line(&mut line).unwrap(); line.split_whitespace().map(|t| t.parse::<$t>() .unwrap () ) .collect ::<Vec <_ >>() } } ;([$t :ty ] ;$n :expr ) =>{(0 ..$n ) .map (|_ |get !([$t ] ) ) .collect ::<Vec <_ >>() } ;($t :ty ) =>{{let mut line :String =String ::new () ;stdin () .read_line (&mut line ) .unwrap () ;line .trim () .parse ::<$t >() .unwrap () } } ;($($t :ty ) ,*) =>{{let mut line :String =String ::new () ;stdin () .read_line (&mut line ) .unwrap () ;let mut iter =line .split_whitespace () ;($(iter .next () .unwrap () .parse ::<$t >() .unwrap () ,) *) } } ;($t :ty ;$n :expr ) =>{(0 ..$n ) .map (|_ |get !($t ) ) .collect ::<Vec <_ >>() } ;($($t :ty ) ,*;$n :expr ) =>{(0 ..$n ) .map (|_ |get !($($t ) ,*) ) .collect ::<Vec <_ >>() } ;}
#[allow(unused_macros)]
macro_rules !debug {($($a :expr ) ,*) =>{eprintln !(concat !($(stringify !($a ) ," = {:?}, " ) ,*) ,$($a ) ,*) ;} }
const BIG_STACK_SIZE: bool = true;
#[allow(dead_code)]
fn main() {
    use std::thread;
    if BIG_STACK_SIZE {
        thread::Builder::new()
            .stack_size(32 * 1024 * 1024)
            .name("solve".into())
            .spawn(solve)
            .unwrap()
            .join()
            .unwrap();
    } else {
        solve();
    }
}
fn solve() {
    let mut input: Vec<u8> = get!([u8]);
    input.sort();
    if input == [5, 5, 7] {
        println!("YES");
    }else{
        println!("NO");
    }
}
//  [rust]
#![allow(unused_imports)]
// use itertools::Itertools;
use proconio::{input, marker::*};

fn main() {
    input! {
        mut abc: [u8; 3]
    };
    abc.sort();
    if (abc[0] == abc[1]) && (abc[0] == 5) && (abc[2] == 7) {
        println!("YES");
    } else {
        println!("NO");
    }
}
//  [rust]
use proconio::input;

fn main() {
    input! {
        mut abc: [i64; 3],
    };
    abc.sort();
    let ans = abc == vec![5, 5, 7];
    println!("{}", if ans { "YES" } else { "NO" });
}
//  [swift]
            let data = readLine()!
            let values = data.characters.split{ x in x == " "}.map{Int(String($0))!}.sort()
            if values[0] == 5 && values[1] == 5 && values[2] == 7 {
                print("YES")
            } else {
                print("NO")
            }
//  [swift]
import Foundation

var input = readLine()
var inputs : [String] = input!.components(separatedBy: " ")

var a = Int(inputs[0])!
var b = Int(inputs[1])!
var c = Int(inputs[2])!

if(a + b + c == 17){
    print("YES")
}else{
    print("NO")
}
//  [typescript]
import * as fs from "fs";

const main = (input: string): void => {
  const numbers = input.split(" ").map((string) => parseInt(string, 10));
  let fives = 0;
  let sevens = 0;

  numbers.forEach((num) => {
    if (num === 5) fives += 1;
    if (num === 7) sevens += 1;
  });

  if (fives === 2 && sevens === 1) console.log("YES");
  else console.log("NO");
};

fs.readFile("/dev/stdin", (err, data) => {
  if (err) {
    main(fs.readFileSync("./input.txt", "utf8"));
    return null;
  }
  main(data.toString());
  return null;
});
//  [typescript]
"use strict";
const Main = (input) =>{
   let xs = input.trim().split(' ').map(v=>parseInt(v,10));
   let ans1 = 0;
   let ans2 = 0; 
  
   for(let i=0; i<xs.length; i++){
     if(xs[i]==5){
       ans1++
     }else if(xs[i]==7){
       ans2++
     }
   }
   if(ans1==2&&ans2==1){
     console.log('YES');
   }else{
     console.log('NO');
   }
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));
//  [typescript]
"use strict";
process.stdin.resume();
process.stdin.setEncoding("utf8");

var reader = require("readline").createInterface({
  input: process.stdin,
  output: process.stdout
});

reader.on("line", (line: string): void => {
  const str: string = line.split(/\s/).map((x: string) => parseInt(x)).sort().toString(); 
  console.log(str === '5,5,7' ? 'YES' : 'NO');
});
//  [python]
import numpy as np
from collections import defaultdict
from collections import Counter
from collections import OrderedDict
#key = {1:2, 2:5, 3:5, 4:4, 5:5, 6:6, 7:3, 8:7, 9:6}
# A = int(input())
A, B = (int(i) for i in input().split())
sum1 = 0
if A < B:
    sum1 += B
    B -= 1
else:
    sum1 += A
    A -= 1
if A < B:
    sum1 += B
    B -= 1
else:
    sum1 += A
    A -= 1
print(sum1)
//  [python]
#
import sys
import math
import numpy as np
import itertools

# いくつか入力
a, b = (int(i) for i in input().split())  

answer =0
for i in range(2):
    if a > b:
        answer += a
        a -= 1
    else:
        answer += b
        b -= 1

print(answer)
//  [python]
# coding: utf-8
import numpy as np
from functools import lru_cache
import time

def main(): 
    if True:
        H,W = list(map(int, input().split()))
    else:
        pass

    if H == W :
        print(H+W)
    else :
        print(max(H,W)*2-1)
if __name__ =='__main__':
    main()
//  [java]
import java.util.Scanner;

class Main {
	public static void main(String[] args) {
	
	Scanner stdIn = new Scanner(System.in);

	int a = stdIn.nextInt();
	int b = stdIn.nextInt();
	int coin = 0;
	
	for (int i = 0; i < 2; i++) {
		if (a >= b) {
			coin += a;
			a--;
		} else {
			coin += b;
			b--;
		}
	}
	
	System.out.println(coin);
	
	}
}
//  [java]
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
import java.util.function.Consumer;

import static java.util.stream.Collectors.toList;

public class Main {
    private static final Scanner scanner = new Scanner(System.in);
    private static final Consumer<List<String>> consumer = solve();

    public static void main(String[] args) {
        consumer.accept(readInput());
    }

    private static List<String> readInput() {
        final List<String> lineList = new ArrayList<>();
        while (scanner.hasNextLine()) {
            lineList.add(scanner.nextLine());
        }
        return lineList;
    }

    private static Consumer<List<String>> solve() {
        return args -> {
            final List<Long> numList = Arrays.stream(args.get(0).split(" ")).map(Long::valueOf).collect(toList());
            if (numList.get(0) > numList.get(1)) {
                System.out.println(2 * numList.get(0) - 1);
            } else if (numList.get(1) > numList.get(0)) {
                System.out.println(2 * numList.get(1) - 1);
            } else {
                System.out.println(2 * numList.get(0));
            }
        };
    }

}
//  [cpp]
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#define INPUT(X) cin >> X
#define OUTPUT(X) cout << X << endl

using namespace std;

int main(void) {

	int A,B;
	int X = 0;


	INPUT(A);
	INPUT(B);

	for(int i = 0 ; i < 2 ; i++){
		X += max(A,B);
		if(A>B){
			A--;
		}else{
			B--;
		}
	}


	OUTPUT(X);

}
//  [cpp]
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define ll long long
#define endl '\n'
using namespace std;
int dy[4] = {1, 0, -1, 0}, dx[4] = {0, 1, 0, -1};
typedef pair<ll, ll> P;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a, b;
    cin >> a >> b;
    if (a == b) {
        cout << a + b << endl;
    } else {
        cout << 2 * max(a, b) - 1 << endl;
    }
    return 0;
}
//  [c]
#include<stdio.h>
int main()
{
	int a,b;
	scanf("%d %d",&a,&b);
	if(a>b){
		printf("%d\n",a+(a-1));
	}
	if(b>a){
		printf("%d\n",b+(b-1));
	}
	if(a==b){
		printf("%d\n",a*2);
	}
	return 0;
}
//  [c]
#include<stdio.h>
int main(void)
{
	int a,b;
	int sum=0;
	scanf("%d%d",&a,&b);
	
	if(a>b){
	sum=a;
	a--;
	}
	else{
	sum=b;
	b--;
	}
	
	if(a>b)
	sum=sum+a;
	else
	sum=sum+b;
	
	printf("%d",sum);

	return 0;
}
//  [c]
#include <stdio.h>
#include <math.h>

void sort(int *arr, int n);

int main(){
    int a,b;
    scanf("%d %d\n", &a, &b);
    int m1,m2,m3,ans;
    m1 = a + (a-1);
    m2 = b + (b-1);
    m3 = a + b;
    int arr[4];
    arr[0] = m1;
    arr[1] = m2;
    arr[2] = m3;

    sort(arr, 3);

    ans = arr[2];

    printf("%d\n", ans);

}

void sort(int *arr, int n){
    int i,j,temp=0;
    for(i=0;i<n-1;i++){
        for(j=0;j<n-1;j++){
            if(arr[j] > arr[j+1]){
                temp = arr[j];
                arr[j] = arr[j+1];
                arr[j+1] = temp;
            }
        }
    }
}
//  [javascript]
'use strict';

var hasN = false; // has N *only* line
var type = "b";
// a: 2D split
// b: space split
// c: line split
// z: other (only source)
function main(N, p, s) {
  // N, processed data, source
  var big = p[0] > p[1] ? 0 : 1;
  var a = 0;
  a += p[big];
  p[big]--;
  big = p[0] > p[1] ? 0 : 1;
  a += p[big];
  console.log(a);
}
function common(a) {
  var line = a.split('\n').slice(0, a.split('\n').length - 1);
  if (hasN) var N = Number(line.shift());
  switch (type) {
    case "a":
      main(N, line.map(function (e) {
        return e.split(' ').map(function (ee) {
          return Number(ee);
        });
      }), a);
      break;
    case "b":
      main(N, line[0].split(' ').map(function (e) {
        return Number(e);
      }), a);
      break;
    case "c":
      main(N, line, a);
      break;
    case "z":
      main(N, null, a);
  }
}
common(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
module.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";var r=n(1);n(2)(r.readFileSync("/dev/stdin","utf8"))},function(t,e){t.exports=require("fs")},function(t,e,n){"use strict";var r=n(3),i=n(5);t.exports=function(t){var e=new r(t);i(e)}},function(t,e,n){"use strict";var r=n(4);t.exports=class{constructor(t){var e=t.trim().split(/\s+/g);this.inp=new r(e)}inr(){return this.inp.deq()}in(){return parseInt(this.inp.deq(),10)}fin(){this.inp.clear()}}},function(t,e,n){"use strict";t.exports=class{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.size=t.length,this.items=t,this.ind=0}enq(t){this.size+=1,this.items.push(t)}deq(){var t=this.items[this.ind];return this.size-=1,this.ind+=1,t}clear(){this.items=[],this.size=0,this.ind=0}}},function(t,e,n){"use strict";t.exports=function(t){var e=t.in(),n=t.in(),r=0;e>=n?(r+=e,r+=--e>=n?e:n):(r+=n,r+=e>=--n?e:n),console.log(r)}}]);
//  [javascript]
function Main(input) {
    // 1行目がinput[0], 2行目がinput[1], …に入る
    A = Number(input.split(" ")[0]);
    B = Number(input.split(" ")[1]);
    answer = 0;

    if(A >= B){
        answer += A;
        A =A -1;
    }else{
        answer += B;
        B =B -1;
    }

    if(A >= B){
        answer += A;
        A =A -1;
    }else{
        answer += B;
        B =B -1;
    }


    
    console.log(answer);
}
    


//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

import (
	"fmt"
)

func main() {
	var a, b int
	fmt.Scan(&a, &b)

	ans := 0
	n := 2
	for i := 0; i < n; i++ {
		if a > b {
			ans += a
			a--
		} else {
			ans += b
			b--
		}
	}
	fmt.Println(ans)
}
//  [ruby]
#!/usr/bin/env ruby

require 'set'

class Hash
  def push(key, value)
    self[key] = [] if self[key] == nil
    self[key].push(value)
  end
end

class Array
  def lower_bound(value)
    left = -1;
    right = self.length;
    while left + 1 < right
      mid = left + (right - left) / 2;
      if self[mid] >= value
        right = mid
      else
        left = mid
      end
    end
    right
  end

  def unique
    res = [self.first]
    each_cons(2) do |a, b|
      if a != b
        res.push(b)
      end
    end
    res
  end
end

def get_ints
  gets.chomp.split.map(&:to_i)
end

def get_ints_minus_one
  get_ints.map { |x| x - 1 }
end

def get_int
  gets.chomp.to_i
end

A, B = get_ints

max = [A, B].max
min = [A, B].min

if max > min
  puts max * 2 - 1
else
  puts max * 2
end
//  [ruby]
a = gets.split.map(&:to_i).sort
num = a[1]
a[1]-=1
num += a.max
puts num
//  [ruby]
a,b = gets.chomp.split(' ').map(&:to_i)
puts [2*a -1, 2*b-1,a+b].max
//  [rust]
use itertools::Itertools;
use proconio::input;
use proconio::marker::{Chars, Usize1};
use std::cmp::*;
use std::collections::*;
use std::iter::Iterator;

#[allow(unused_macros)]
macro_rules! max {
    ($x:expr) => {
      $x
    };
    ($x:expr, $($xs:tt)+) => {
      max($x,max!($($xs)+))
    };
  }

#[allow(unused_macros)]
macro_rules! min {
    ($x:expr) => {
      $x
    };
    ($x:expr, $($xs:tt)+) => {
      min($x,min!($($xs)+))
    };
  }

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

fn main() {
  input! {
  a: i64,
  b: i64,
  }

  let mut ans = 0;
  if a < b {
    ans = b + b - 1;
  } else if a > b {
    ans = a + a - 1;
  } else {
    ans = a * 2;
  }

  println!("{}", ans);
}
//  [rust]
use proconio::{fastout, input};

#[fastout]
fn main() {
    input!(a: usize, b: usize);
    let mut ab = vec![a, b, std::cmp::max(a, b) - 1];
    ab.sort();
    println!("{}", ab[2] + ab[1]);
}
//  [typescript]
namespace Coder {
  class Scanner {
    private buffer: string = '';
    private stdinQueue: any = [];

    constructor() {
      process.stdin.resume();
      process.stdin.setEncoding('utf8');
      process.stdin.on(
        'data',
        (chunk): void => {
          this.buffer += chunk;
          while (this.stdinQueue.length > 0) {
            const i = this.buffer.indexOf('\n');
            if (i < 0) {
              break;
            }
            let line = this.buffer.substr(0, i);
            if (line.endsWith('\r')) {
              line = line.slice(0, -1);
            }
            this.buffer = this.buffer.substr(i + 1);
            this.stdinQueue.shift()(line);
          }
        },
      );
    }
    public getLine(): Promise<string> {
      return new Promise((resolve, reject) => {
        const i = this.buffer.indexOf('\n');
        if (i >= 0 && this.stdinQueue.length === 0) {
          let line = this.buffer.substr(0, i);
          if (line.endsWith('\r')) {
            line = line.slice(0, -1);
          }
          this.buffer = this.buffer.substr(i + 1);
          resolve(line);
        } else {
          this.stdinQueue.push(resolve);
        }
      });
    }

    public close(): void {
      process.stdin.pause();
    }
  }

  async function solve() {
    const sc = new Scanner();
    let [A, B]: number[] = (await sc.getLine()).split(' ').map((x) => +x);
    let ans = 0;
    for (let i = 0; i < 2; i += 1) {
      if (A > B) {
        ans += A;
        A -= 1;
      } else {
        ans += B;
        B -= 1;
      }
    }
    console.log(ans);

    sc.close();
  }

  solve();
}
//  [typescript]
const fs = require('fs')
const stdin = fs.readFileSync('/dev/stdin', 'utf8')

let [A,B] = stdin.split('\n')[0].split(' ').map(Number)

let coin = 0

for(let i = 0; i < 2; i++){
  if(A<B){
    coin += B
    B--
  }else {
    coin += A
    A--
  }
}

console.log(coin)
//  [typescript]
const input = require('fs').readFileSync('/dev/stdin', 'utf8')

let [a, b]: number[] = input.split('\n')[0].split(' ').map(Number)
let coins = 0
for (let i = 0; i < 2; i++) {
  if (a >= b) {
    coins += a
    a -= 1
  }
  else {
    coins += b
    b -= 1
  }
}
console.log(coins)
//  [python]
from sys import exit, setrecursionlimit
from functools import reduce
from itertools import *

def read():
  return int(input())

def reads():
  return [int(x) for x in input().split()]

setrecursionlimit(10000)

s = input()
print(s[:4] + " " + s[4:])
//  [python]
S = input()
print(S[0:4] + ' ' + S[4:])
//  [python]
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = 1e10

#solve
def solve():
    s = S()
    print(s[:4], s[4:])
    return


#main
if __name__ == '__main__':
    solve()
//  [java]
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.util.StringTokenizer;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author phantom11
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            String s = in.next();
            out
                    .printLine(s.substring(0, 4) + " " + s.substring(4));
        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0)
                    writer.print(' ');
                writer.print(objects[i]);
            }
        }

        public void printLine(Object... objects) {
            print(objects);
            writer.println();
        }

        public void close() {
            writer.close();
        }

    }

    static class InputReader {
        BufferedReader in;
        StringTokenizer tokenizer = null;

        public InputReader(InputStream inputStream) {
            in = new BufferedReader(new InputStreamReader(inputStream));
        }

        public String next() {
            try {
                while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                    tokenizer = new StringTokenizer(in.readLine());
                }
                return tokenizer.nextToken();
            } catch (IOException e) {
                return null;
            }
        }

    }
}
//  [java]
import java.util.Scanner;


public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String line = sc.next();
		System.out.println(line.substring(0, 4) + " " + line.substring(4));
	}

}
//  [java]
import java.util.*;
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 s = br.readLine();

		//文字列きりだし
		String new_str1 = s.substring(2, 5);

		System.out.print(s.substring(0, 4));
		System.out.print(" ");
		System.out.print(s.substring(4, 12));

		System.out.println("");             //画面表示

    }
}
//  [cpp]
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <cstdio>
#include <cstring>
using namespace std;

int main()
{
    string s;
    cin >> s;
    cout << s.substr(0, 4) << " " << s.substr(4) << endl;
    return 0;
}
//  [cpp]
#include<iostream>
#include<cmath>
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
char ch[20];
int main(){
	scanf("%s",ch+1);
	for (int i=1;i<=4;i++) putchar(ch[i]);
	putchar(' ');
	for (int i=5;i<=12;i++) putchar(ch[i]);
	putchar('\n');
}
//  [cpp]
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <climits>
#include <ctime>
#include <cassert>
using namespace std;

#define rep(i,a,n) for(int i=a; i<n; i++)
#define repr(i,a,n) for(int i=a; i>=n; i--)
#define pb(a) push_back(a)
#define fr first
#define sc second
#define INF 999999999

#define X real()
#define Y imag()
#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)
#define EQV(a,b) ( EQ((a).X, (b).X) && EQ((a).Y, (b).Y) )
#define LE(n, m) ((n) < (m) + EPS)
#define LEQ(n, m) ((n) <= (m) + EPS)
#define GE(n, m) ((n) + EPS > (m))
#define GEQ(n, m) ((n) + EPS >= (m))

typedef vector<int> VI;
typedef vector<VI> MAT;
typedef pair<int, int> pii;
typedef long long int ll;

typedef complex<double> P;
typedef pair<P, P> L;
typedef pair<P, double> C;

int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
int const MOD = 1000000007;

namespace std {
    bool operator<(const P& a, const P& b) {
        return a.X != b.X ? a.X < b.X : a.Y < b.Y;
    }
}

int main() {
    string s; cin >> s;

    rep(i,0,4) cout << s[i];
    cout << " ";
    rep(i,4,s.length()) cout << s[i];
    cout << endl;
    return 0;
}
//  [c]
#include <stdio.h>
int main(void){
    char buf[25];
    
    scanf("%s",buf);
   
    char temp;
    for(int i=0;i<25;i++){
        if(4==i){
            temp=buf[i];
            buf[i]=' ';
        }else if(4 < i){
            int t=buf[i];
            buf[i] = temp;
            temp=t;
        }
    }
    printf(buf);
    printf("\n");
    
}
//  [c]
#include <stdio.h>

int main(){
  char S[13];
  scanf("%s",S);
  for(int i=0;i<12;i++){
    printf("%c",S[i]);
    if(i==3) printf(" ");;
  }
  printf("\n");
  return 0;
}
//  [c]
#include<stdio.h>

int main(void){
	char a[256];
	scanf("%s",a);

	printf("%c%c%c%c %c%c%c%c%c%c%c%c\n",a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],a[11]);

	return 0;
}
//  [javascript]
'use strict';
const inputs = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\n');

let a = inputs[0];
console.log(`${a.substr(0, 4)} ${a.substr(4)}`);
//  [javascript]
function Main(input) {
  input = input.split("\n");
  string = input[0];
  var space = " ";
  var position = 4;
  var output = [string.slice(0, position), space, string.slice(position)].join('');
  console.log(output);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
(function() {
  'use strict';
  var lines = [];
  require('readline').createInterface({
    input: process.stdin,
    output: process.stdout
  }).on('line', function(line) {
    lines.push(line);
  });
  process.stdin.on('end', function() {
      console.log(lines[0].substring(0, 4) + ' ' + lines[0].substring(4));
  });
})();
//  [go]
package main

import (
  "fmt"
)

func main() {
  var s string
  fmt.Scanf("%s", &s)
  
  ans := s[0:4] + " " + s[4:12]
  
  fmt.Printf("%s\n", ans)
}
//  [go]
package main

import "fmt"

func main() {
	// Code for A - CODEFESTIVAL 2016
	var s string
	fmt.Scan(&s)

	fmt.Println(s[0:4] + " " + s[4:12])
}
//  [ruby]
s=gets
puts s[0,4]+?\s+s[4..]
//  [ruby]
require 'pp'

s = gets.chomp!.chars
puts "#{s[0, 4].join} #{s[4, s.length].join}"
//  [ruby]
a = $stdin.read
puts a[0,4] + " " + a[4,8]
//  [rust]
#![allow(unused_imports)]

use text_io::*;
use proconio::*;
use std::collections::*;
use itertools::Itertools;
use std::process::exit;
use std::cmp::*;
use num::*;
use num::integer::Roots;

fn main() {
    input! {
    a:String,
    }
    let a=a.chars().collect_vec();
    let mut v:Vec<char>=Vec::new();
    for i in 0..a.len(){
        v.push(a[i]);
        if i==3 {v.push(' ')}
    }
    let v:String=v.iter().collect();
    println!("{}",v)
}
//  [rust]
use std::io::Read;

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

    let answer = solve(&buf);

    println!("{}", answer);
}

fn solve(input: &str) -> String {
    let mut iterator = input.split_whitespace();

    let s = iterator.next().unwrap();
    return format!("{} {}", &s[0..4], &s[4..12]);
}
//  [rust]
use std::io::Read;

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

    let answer = solve(&buf);

    println!("{}", answer);
}

fn solve(input: &str) -> String {
    let mut iterator = input.split_whitespace();

    let s: String = iterator.next().unwrap().to_string();
    return format!("{} {}", &s[0..4], &s[4..12]);
}
//  [swift]
import Foundation

let str = readLine(stripNewline: true)

var str_arr = Array(str!.characters)

str_arr.insert(" ", atIndex: 4)
let new_arr = String(str_arr)

print("\(new_arr)")
//  [python]
import sys
def LI(): 
    return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり

n,m = LI()

print((n-1)*(m-1))
//  [python]
from copy import deepcopy
from sys import exit,setrecursionlimit
import math
from collections import defaultdict,Counter,deque
from fractions import Fraction as frac

setrecursionlimit(1000000)


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

def zip(a):
	mae = a[0]
	ziparray = [mae]
	for i in range(1,len(a)):
		if(mae != a[i]):
			ziparray.append(a[i])
			mae = a[i]
	return ziparray

def is_prime(n):
	if n < 2: return False

	for k in range(2, int(math.sqrt(n)) + 1):
		if n % k == 0:
			return False

	return True

def list_replace(n,f,t):
	return [t if i==f else i for i in n]

def base_10_to_n(X, n):
	X_dumy = X
	out = ''
	while X_dumy>0:
		out = str(X_dumy%n)+out
		X_dumy = int(X_dumy/n)
	if(out == ''): return '0'
	return out

def gcd(l):
	x = l.pop()
	y = l.pop()
	while(x%y!=0):
		z = x%y
		x = y
		y = z
	l.append(min(x,y))
	return gcd(l) if len(l) > 1 else l[0]

class Queue():
	def __init__(self):
		self.q = deque([])
	def push(self,i):
		self.q.append(i)
	def pop(self):
		return self.q.popleft()
	def size(self):
		return len(self.q)
	def debug(self):
		return self.q

class Stack():
	def __init__(self):
		self.q = []
	def push(self,i):
		self.q.append(i)
	def pop(self):
		return self.q.pop()
	def size(self):
		return len(self.q)
	def debug(self):
		return self.q

class graph():
	def __init__(self):
		self.graph = defaultdict(list)
	def addnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].append(t)
		self.graph[t].append(f)
	def rmnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].remove(t)
		self.graph[t].remove(f)
	def linked(self,f):
		return self.graph[f]

class dgraph():
	def __init__(self):
		self.graph = defaultdict(set)
	def addnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].append(t)
	def rmnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].remove(t)
	def linked(self,f):
		return self.graph[f]

main()
//  [python]
import math
import calendar
import fractions
import itertools

n, m = map(int, input().split())

print((n - 1) * (m - 1))
//  [java]
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();

		System.out.println((N-1) * (M-1));
	}
}
//  [java]
import java.util.Scanner;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    System.out.println((a-1)*(b-1));
  }
}
//  [java]
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		new Main().solve();
	}
	
	void solve(){
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int m=sc.nextInt();
		System.out.println((n-1)*(m-1));
	}
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
#define dhoom ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);  
typedef long long ll;
typedef long double ld;
const ll inf = 1e18;
const int nax = 2e6 + 7;
const ll mod = 1e9 + 7;
//ll tree[4 * nax];
//9uS-22RSwk7gQqh

map< int , int > mp[nax];
int main()
{
	int n , m;
	cin >> n >> m;
	cout << (n - 1 ) * ( m - 1 ) << endl;
	return 0;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
 
#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define FOR(e, c) for (auto &e : c)
#define SORT(v, n) sort(v, v + n);
#define vsort(v) sort(v.begin(), v.end());
#define rvisort(v) sort(v.begin(), v.end(), greater<int>());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
 
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using vpii = vector<pii>;
using vs = vector<string>;
using vd = vector<double>;
using ul = unsigned long;
 
template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }
 
const int mod=1e9+7;
 
struct mint {
  ll x;
  mint(ll x=0):x(x%mod){}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
};
 
mint c[4005][4005];
void init() {
  c[0][0] = 1;
  for (int i = 0; i <= 4000; i++) {
    for (int j = 0; j <= i; j++) {
      c[i+1][j] += c[i][j];
      c[i+1][j+1] += c[i][j];
    }
  }
}
mint comb(int n, int k) {
  return c[n][k];
}
 
bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false;
 
    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            return false;
        }
    }
 
    return true;
}
 
map<ll, ll> primeFact(ll n) {
  map<ll, ll> res;
  for (ll i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      res[i]++;
      n /= i;
    }
  }
  if (n != 1) res[n]++;
  return res;
}
 
void printv(vi& v){
  rep(i,v.size()) cout << v[i] << " ";
  cout << endl;
}
void printv(vll& v){
  rep(i,v.size()) cout << v[i] << " ";
  cout << endl;
}
int vtotal(vi& v){
  int total=0;
  rep(i,v.size()) total+=v[i];
  return total;
}
 
int main()
{
  //init(); // mint初期化
  cin.tie( 0 );
  ios::sync_with_stdio( false );
  
  int n,m;cin>>n>>m;
  int ans=(n-1)*(m-1);
  cout(ans);
  
  return 0;
}
//  [cpp]
//#include <conio.h>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>

using namespace std;

int main()
{
	int n, m;
	cin >> n >> m;
	cout << (n - 1)*(m - 1);
	//_getch();
	return 0;
}
//  [c]
#include <stdio.h>
int main()
{
    int n, m, a;
    scanf("%d %d", &n, &m);
    n = n-1;
    m = m-1;
    a = n*m;
    printf("%d", a);
    return 0;
}
//  [c]
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<stdlib.h>

int main() {
    int n, m, ans;

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

    ans = (n - 1) * (m - 1);

    printf("%d\n", ans);
    return 0;
}
//  [c]
#include <stdio.h>
int main(void){
    int a, b;
    
    scanf("%d %d", &a, &b);
    printf("%d\n", (a - 1) * (b - 1));
}
//  [javascript]
function main(input) {
   input = input.trim();
  const a = input.split(" ").map(Number);
 
 console.log((a[0]-1)*(a[1]-1));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
"use strict";

const main = arg => {
    const n = arg.split("\n")[0].split(" ")[0];
    const m = arg.split("\n")[0].split(" ")[1];
    
    console.log((n - 1) * (m - 1));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
function Main(input){
    input = input.split(" ");
    var x = parseInt(input[0]) - 1;
    var y = parseInt(input[1]) - 1;

    console.log('%d', x * y);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	scanInit()

	n := nextInt()
	m := nextInt()

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

}

// ---- readfunc
var sc = bufio.NewScanner(os.Stdin)

func scanInit() {
	const cap = 200 * 1024 // default=64*1024
	var buf = make([]byte, cap)
	sc.Buffer(buf, cap)
	sc.Split(bufio.ScanWords)
	return
}
func nextInt() int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return i
}
func nextStr() string {
	sc.Scan()
	return sc.Text()
}
//  [go]
package main

import "fmt"

func main() {
	// Code for A - K-City
	var n, m int
	fmt.Scanf("%d %d", &n, &m)
	fmt.Println((n - 1) * (m - 1))
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func Scanner() string {
	sc.Scan()
	return sc.Text()
}

func intScanner() int {
	n, _ := strconv.Atoi(Scanner())
	return n
}

func floatScanner() float64 {
	n, _ := strconv.ParseFloat(Scanner(), 64)
	return n
}
func stringToInt(s string) int {
	n, _ := strconv.Atoi(s)
	return n
}
func stringSliceScanner(n int) []string {
	a := make([]string, n)
	for i := 0; i < n; i++ {
		a[i] = Scanner()
	}
	return a
}
func intSliceScanner(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = intScanner()
	}
	return a
}
func larger(a, b int) int {
	if a < b {
		return b
	} else {
		return a
	}
}
func smaller(a, b int) int {
	if a > b {
		return b
	} else {
		return a
	}
}
func max(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x < a[i] {
			x = a[i]
		}
	}
	return x
}
func min(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x > a[i] {
			x = a[i]
		}
	}
	return x
}
func abs(x int) int {
	if x < 0 {
		x = -x
	}
	return x
}

var mod int = 1000000007

func main() {
	buf := make([]byte, 0)
	sc.Buffer(buf, mod)
	sc.Split(bufio.ScanWords)
	n := intScanner()
	m := intScanner()
	fmt.Println((n - 1) * (m - 1))
}
//  [ruby]
n,m = gets.chop.split.map(&:to_i)

puts (n-1)*(m-1)
//  [ruby]
n,m=gets.split.map(&:to_i)
puts (n-1)*(m-1)
//  [ruby]
a,b = gets.split.map(&:to_i)
puts (a-1)*(b-1)
//  [rust]
#![allow(unused_imports)]
// use itertools::Itertools;
use proconio::{input, marker::*};

fn main() {
    input! {
        n: isize,
        m: isize
    };
    println!("{}", (n - 1) * (m - 1));
}
//  [rust]
use proconio::input;
#[allow(unused_imports)]
use proconio::marker::{Bytes, Chars};
#[allow(unused_imports)]
use std::cmp::{min, max};

fn main() {
	input! {
		n: usize,
		m: usize,
	}

	println!("{}", (n-1)*(m-1));
}
//  [swift]
import Foundation
 
let input_line: String = readLine()!
let split: [String] = input_line.components(separatedBy: " ")
 
let n = Int(split[0])!
let m = Int(split[1])!

print((n-1)*(m-1))
//  [typescript]
"use strict";
const Main = (input) => {
	let xs = input.trim().split(' ').map(v=>parseInt(v,10));
    let n = xs[0]-1;
    let m = xs[1]-1;
   	console.log(n*m);
}

Main(require('fs').readFileSync('/dev/stdin','utf8'));
//  [typescript]
import { readFileSync } from "fs";

const read = () =>
  readFileSync(0, "utf8")
    .split("\n")
    .map((line) => line.split(" "));

const main = (input: string[][]) => {
  const [n, m] = input[0].map(Number);

  return (n - 1) * (m - 1);
};

console.log(main(read()));
//  [typescript]
const stdin = require('fs').readFileSync('/dev/stdin', 'utf8')

const [n, m] = stdin
  .split('\n')[0]
  .split(' ')
  .map(Number)

console.log((n - 1) * (m - 1))