jiahuimbzuai/CoQuIR huggingface dataset:
//  [rust]
/* {{{ */
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! {
        c: chars
    }
    println!("{}", ((c[0] as u8) + 1) as char);
}
/* vim:set foldmethod=marker: */
//  [rust]
use std::io::*;
use std::str::FromStr;


//https://qiita.com/tubo28/items/e6076e9040da57368845
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 c: char = read::<String>().chars().next().unwrap();

    let next = (c as u8 + 1) as char;
    println!("{}",next);
}
//  [rust]
use proconio::input;

fn main() {
  input! {
    c: char,
  };
  println!("{}", std::char::from_u32(c as u32 + 1).unwrap());
}
//  [swift]
func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

func main() {
    let next: [String: String] = [
        "a": "b",
        "b": "c",
        "c": "d",
        "d": "e",
        "e": "f",
        "f": "g",
        "g": "h",
        "h": "i",
        "i": "j",
        "j": "k",
        "k": "l",
        "l": "m",
        "m": "n",
        "n": "o",
        "o": "p",
        "p": "q",
        "q": "r",
        "r": "s",
        "s": "t",
        "t": "u",
        "u": "v",
        "v": "w",
        "w": "x",
        "x": "y",
        "y": "z"
    ]
    let c = readLine()!
    print(next[c]!)
}

main()
//  [swift]
let arr=Array(readLine()!.unicodeScalars)

print(Character(UnicodeScalar(arr[0].value + 1)))
//  [typescript]
import * as fs from 'fs'

const c :string = fs.readFileSync('/dev/stdin','utf8');
// in:a
// out:b
console.log(String.fromCharCode(c.charCodeAt(0) + 1))
//  [typescript]
import * as fs from "fs";

const input = (fs.readFileSync("/dev/stdin", "utf8") as string).split("\n");
//const n = +input[0];
//const a = [];
//for(let i=0;i<n;i++){
//	a.push(input[i+1].split(" ").map((x:string):number=>+x));
//}

const c = input[0];
const s = 'abcdefghijklmnopqrstuvwxyz'.split('');
let ans = 'a';

for (let i=0; i < 27; i++){
	if (s[i] === c) {
		ans = s[i+1];
	}

}
console.log(ans);
//  [typescript]
function Main(input) {
    lines = input.split("\n");
    const c = lines[0]
    
	console.log( String.fromCharCode(c.charCodeAt(0) + 1) );
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [typescript]
"use strict";

const main = arg => {
  const C = arg.trim().split("\n");
  const idx = "abcdefghijklmnopqrstuvwxyz".indexOf(C) ;
   console.log("abcdefghijklmnopqrstuvwxyz".substring(idx+ 1, idx + 2);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [typescript]
{
  const main = (
    input: string
  ): void | string | number | string[] | number[] => {
    const r = _reader(input)
    const c = r.s()

    return String.fromCharCode(c.charCodeAt(0) + 1)
  }

  const _reader = (str: string, i = 0) => {
    const lines = str.trim().split('\n')
    const s = () => lines[i++] || ''
    const n = () => Number(s())

    const mn = (v: string[]) => v.map(Number)
    const sp = (v: string) => v.split(' ')
    const ss = () => sp(s())
    const nn = () => mn(ss())
    const nls = () => mn(lines.slice(i))
    const nnls = () => lines.slice(i).map(v => mn(sp(v)))

    return { lines, s, n, ss, nn, nls, nnls }
  }

  const _getInput = () => require('fs').readFileSync('/dev/stdin', 'utf8')
  const _res = main(_getInput())

  if (typeof _res === 'number' || typeof _res === 'string') console.log(_res)
  if (typeof _res === 'object') console.log(_res.join(' '))
}
//  [typescript]
const input=require('fs').readFileSync('/dev/stdin','utf8').split(/[\s]/);let input_i=-1;const tn=():number=>{input_i++;return Number(input[input_i])};const tnn=(n:number):number[]=>{const a=[];for(let i=0;i<n;i++){a.push(tn())}return a};const ts=():string=>{input_i++;return String(input[input_i])};const tss=(n:number):string[]=>{const a=[];for(let i=0;i<n;i++){a.push(ts())}return a};const to=(...arg)=>{console.log(...arg)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const floor=(a)=>{return Math.floor(a)};const ceil=(a)=>{return Math.ceil(a)};const asc=(ar:number[])=>{const t=[...ar];return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{const t=[...ar];return t.sort((a,b)=>{return b-a})};const sw=(a,arr:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<arr.length-1;i+=2){if(eval(a+op+arr[i])){return arr[i+1]}}return arr[arr.length-1]};const near=(n:number,arr:number[]):number=>{let ne=arr[0],ni=0;for(let i=1;i<arr.length;i++){if(Math.abs(n-ne)>Math.abs(n-arr[i])){ne=arr[i];ni=i}}return ni};const deduplicate=(a:any[]):any[]=>{return Array.from(new Set(a))};const gcd=(x,y)=>{while(y){[x,y]=[y,x%y]}return x};const sum=(arr)=>{return arr.reduce((a,b)=>a+b);};const isPrime=(n:number):boolean=>{if(n<2)return false;const suq=Math.sqrt(n);for(let i=2;i<=suq;i++){if(n%i==0){return false;}}return true;};
const main=()=>{
  let s=ts()
  to(String.fromCharCode(s.charCodeAt(0)+1))
}
main()
//  [python]
h, w = map(int, input().split())
a, b = map(int, input().split())
print((h - a) * (w - b))
//  [python]
H,W = map(int,input().split())
h,w = map(int,input().split())
print((H-h)*(W-w))
//  [python]
import numpy as np

H, W = map(int, input().split())
h, w = map(int, input().split())

mat = np.ones((H, W), dtype=np.int)

for i in range(h):
    mat[i, :] = 0
for j in range(w):
    mat[:, j] = 0

print(np.sum(mat))
//  [python]
H,W = map(int, raw_input().split(' '))
h,w = map(int, raw_input().split(' '))
print H*W - W*h - H*w + h*w
//  [python]
# -*- coding: utf-8 -*-
 
## Library
 
import sys
from fractions import gcd
import math
from math import ceil,floor
import collections
from collections import Counter
import itertools
import copy
 
## input
 
# N=int(input())
# A,B,C,D=map(int, input().split())
# S = input()
# yoko = list(map(int, input().split()))
# tate = [int(input()) for _ in range(N)]
# N, M = map(int,input().split()) 
#    P = [list(map(int,input().split())) for i in range(M)]
#    S = []
#    for _ in range(N):
#        S.append(list(input()))
 
H,W=map(int, input().split())
S,T=map(int, input().split())

print(H*W - W*S - (H-S)*T)
//  [java]
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;

public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int H = sc.nextInt();
		int W = sc.nextInt();
		int h = sc.nextInt();
		int w = sc.nextInt();

		System.out.println(H * W - (H * w) - (W * h) + h * w);
	}

	private static boolean isDebug = System.getProperty("sun.desktop") != null;

	private static void debug(Object... o) {
		if (isDebug) {
			System.err.println(Arrays.deepToString(o));
		}
	}

	public static class Scanner {
		private BufferedInputStream inputStream;

		public Scanner(InputStream in) {
			inputStream = new BufferedInputStream(in);
		}

		public int nextInt() throws IOException {
			int num = 0;
			int sign = 1;

			int read = skip();
			if (read == '-') {
				sign = -1;
				read = inputStream.read();
			}

			do {
				num = num * 10 + sign * (read - 0x30);
			} while ((read = inputStream.read()) > 0x20);

			return num;
		}

		public void fill(int[] a) throws IOException {
			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
			}
		}

		public void fill(int[] a, int[] b) throws IOException {
			if (a.length != b.length) {
				throw new IllegalArgumentException();
			}

			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
				b[i] = nextInt();
			}
		}

		public long nextLong() throws IOException {
			long num = 0;
			int sign = 1;

			int read = skip();
			if (read == '-') {
				sign = -1;
				read = inputStream.read();
			}

			do {
				num = num * 10 + sign * (read - 0x30);
			} while ((read = inputStream.read()) > 0x20);

			return num;
		}

		public void fill(long[] a) throws IOException {
			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
			}
		}

		public void fill(long[] a, long[] b) throws IOException {
			if (a.length != b.length) {
				throw new IllegalArgumentException();
			}

			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
				b[i] = nextLong();
			}
		}

		public long[] nextLong(int n) throws IOException {
			long[] array = new long[n];
			for (int i = 0; i < n; i++) {
				array[i] = nextLong();
			}

			return array;
		}

		public String next() throws IOException {
			StringBuilder builder = new StringBuilder();

			int read = skip();
			do {
				builder.append((char) read);
			} while ((read = inputStream.read()) > 0x20);

			return builder.toString();
		}

		private int skip() throws IOException {
			int read;
			while ((read = inputStream.read()) <= 0x20)
				;

			return read;
		}
	}
}
//  [java]
import java.io.*;
import java.util.*;
class Main{
	static final long MOD = 1_000_000_007; // 10^9+7
    static final int MAX = 2_147_483_646; // intMax 
    static final int INF = 1_000_000_000; // 10^9  
    public static void main(String[] args) throws Exception {
		hayami saori = new hayami();
		int H = saori.saori_hayami();
		int W = saori.saori_hayami();
		int h = saori.saori_hayami();
		int w = saori.saori_hayami();
		System.out.println((H-h)*(W-w));
		
		saori.close();
    }
}

class hayami implements Closeable {
	private final InputStream in = System.in;
	private final byte[] hayami = new byte[1024];
	private int Hayami = 0;
	private int saori = 0;
	private boolean HayamiSaori() {
		if (Hayami < saori) {
			return true;
		}else{
			Hayami = 0;
			try {
				saori = in.read(hayami);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (saori <= 0) {
				return false;
			}
		}
		return true;
	}
	private int SaoriHayami() { 
		if (HayamiSaori()) {
            return hayami[Hayami++];
         }else{
             return -1;
         }
	}
	private static boolean hayami_saori(int hayami) { 
		return 33 <= hayami && hayami <= 126;
	}
	public boolean hayamisaori() { 
		while(HayamiSaori() && !hayami_saori(hayami[Hayami])) Hayami++; return HayamiSaori();
	}
	public String nextHayami() {
		if (!hayamisaori()) throw new NoSuchElementException();
		StringBuilder hayamin = new StringBuilder();
		int saori = SaoriHayami();
		while(hayami_saori(saori)) {
			hayamin.appendCodePoint(saori);
			saori = SaoriHayami();
		}
		return hayamin.toString();
	}
	public long saorihayami() {//nextLong
		if (!hayamisaori()) throw new NoSuchElementException();
		long hayami = 0;
		boolean misao = false;
		int saori = SaoriHayami();
		if (saori == '-') {
			misao = true;
			saori = SaoriHayami();
		}
		if (saori < '0' || '9' < saori) {
			throw new NumberFormatException();
		}
		while(true){
			if ('0' <= saori && saori <= '9') {
				hayami *= 10;
				hayami += saori - '0';
			}else if(saori == -1 || !hayami_saori(saori)){
				return misao ? -hayami : hayami;
			}else{
				throw new NumberFormatException();
			}
			saori = SaoriHayami();
		}
	}
	public int saori_hayami() {//nextInt
		long hayami = saorihayami();
		if (hayami < Integer.MIN_VALUE || hayami > Integer.MAX_VALUE) throw new NumberFormatException();
		return (int) hayami;
	}
	public double Hayamin() { //nextDouble
		return Double.parseDouble(nextHayami());
	}
	public void close() {
		try {
			in.close();
		} catch (IOException e) {
		}
    }
    
}
//  [java]
import java.util.Scanner;
class Main{
    public static void main(String[] args) {
        //入力
        Scanner scn=new Scanner(System.in);
        int w_h=scn.nextInt();
        int w_w=scn.nextInt();
        int b_h=scn.nextInt();
        int b_w=scn.nextInt();
        //処理と出力
        System.out.println((w_h-b_h)*(w_w-b_w));
    }
}
//  [java]
import java.util.*;
public class Main{
	public static void main(String args[]){
     Scanner sc=new Scanner(System.in);
     int row=sc.nextInt();
     int col=sc.nextInt();
     int n=sc.nextInt();
     int m=sc.nextInt();
     row=row-n;
     col=col-m;
     System.out.println(row*col); 
    } 
}
//  [java]
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int H = sc.nextInt();
		int W = sc.nextInt();
		int h = sc.nextInt();
		int w = sc.nextInt();
		int ans = (H-h)*(W-w);
		System.out.println(ans);
		sc.close();
	}
}
//  [cpp]
#include <cstdio>
#include <cmath>
#include <algorithm>

int main()
{
    int H, W, h, w;
    scanf("%d %d", &H, &W);
    scanf("%d %d", &h, &w);
    int ans = H * W - h * W - w * H + h * w;
    printf("%d\n", ans);
    return 0;
}
//  [cpp]
#include<stdio.h>
int main(){
	int H,W,h,w,a,b,p;
	scanf("%d %d",&H,&W);
	scanf("%d %d",&h,&w);
	a=H-h;b=W-w;p=a*b;
	printf("%d",p);
}
//  [cpp]
#include <stdio.h>

int main(void){
	
	int H, W, h, w; scanf("%d %d %d %d", &H, &W, &h, &w);
	printf("%d", H*W - (h*w + h*(W-w) + w*(H-h)));
	
	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 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 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 h,w;cin>>h>>w;
  int hh,ww;cin>>hh>>ww;
  int ans=h*w-(hh*w+ww*h)+hh*ww;
  cout<<ans<<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 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 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 h,w;cin>>h>>w;
  int hh,ww;cin>>hh>>ww;
  int ans=h*w-(hh*w+ww*h)+hh*ww;
  cout<<ans<<endl;

  return 0;
}
//  [cpp]
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <typeinfo>
#include <numeric>
#include <functional>
#include <unordered_map>
#include <bitset>
#include <stack>


using namespace std;
using ll = long long;
using ull = unsigned long long;

const ll INF = 1e16;
const ll MOD = 1e9 + 7;

#define REP(i, n) for(ll i = 0; i < n; i++)






int main() {
    ll H, W, h, w;
    cin >> H >> W >> h >> w;
    cout << (H - h) * (W - w) << endl;
}
//  [c]
// 2019.9.9 bal4u
// Template for Online Contest

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>

typedef long long ll;

#define gc() getchar()
#define pc(c) putchar(c)

int in() {  // 整数の入力
	int n = 0, c = gc();
	if (c == '-') {	c = gc();
		do n = 10*n + (c & 0xf), c = gc(); while (c >= '0');
		return -n;
	}
	do n = 10*n + (c & 0xf), c = gc(); while (c >= '0');
	return n;
}

ll inL() {  // long long 整数の入力
	ll n = 0; int c = gc();
	if (c == '-') {	c = gc();
		do n = 10*n + (c & 0xf), c = gc(); while (c >= '0');
		return -n;
	}
	do n = 10*n + (c & 0xf), c = gc(); while (c >= '0');
	return n;
}

void out(int n) { // 整数の表示
	int i; char b[30];
	if (!n) pc('0');
	else {
		if (n < 0) pc('-'), n = -n;
		i = 0; while (n) b[i++] = n % 10 + '0', n /= 10;
		while (i--) pc(b[i]);
	}
	pc('\n');
}

void outL(ll n) { // 整数の表示
	int i; char b[30];
	if (!n) pc('0');
	else {
		if (n < 0) pc('-'), n = -n;
		i = 0; while (n) b[i++] = n % 10 + '0', n /= 10;
		while (i--) pc(b[i]);
	}
	pc('\n');
}

int ins(char *s) { // 文字列の入力
	char *p = s--;
	do *++s = gc();
	while (*s > ' ');
	*s = 0;
	return s - p;
}

void outs(char *s) {  // 文字列の表示
	while (*s) pc(*s++);
}

#define MIN(a,b)  ((a)<=(b)?(a):(b))
#define MAX(a,b)  ((a)>=(b)?(a):(b))
#define ABS(a)    ((a)>=0?(a):-(a))
inline static int chmax(int *a, int b) { if (*a < b) *a = b; }
inline static ll  chmaxL(ll *a, int b) { if (*a < b) *a = b; }
inline static int chmin(int *a, int b) { if (*a > b) *a = b; }
inline static ll  chminL(ll *a, int b) { if (*a > b) *a = b; }

int cmp_int(const void *u, const void *v) { return *(int *)u - *(int *)v; }

int main()
{
	int H, W, h, w, white, black;

	H = in(), W = in(), h = in(), w = in();
	white = H*W, black = h*W+w*H-h*w;
	out(white-black);
	return 0;
}
//  [c]
#include<stdio.h>
int main(void)
{
  int H,W,h,w;
  scanf("%d",&H);
  scanf("%d",&W);
  scanf("%d",&h);
  scanf("%d",&w);
  printf("%d",H*W-h*W-w*H+h*w);
  
  return 0;
}
//  [c]
#include <stdio.h>
 
int main(void){
    int a, b, c, d, e;
    scanf("%d", &a);
    scanf("%d", &b);
    scanf("%d", &c);
    scanf("%d", &d);
        e = a * b - (a * d + b * c -c * d);
    printf("%d", e);
    return 0;
}
//  [c]
#include<stdio.h>
int main()
{
    int a,b,c,d,r,x,y,z;

    scanf("%d %d %d %d",&a,&b,&c,&d);

    x = a-c;
    y = b-d;

    z = x*y;

    printf("%d",z);

    return 0;
}
//  [c]
#include<stdio.h>
int main()
{
    int a,b,c,d,total;
    scanf("%d %d %d %d",&a,&b,&c,&d);
    total=(a-c)*(b-d);
    printf("%d\n",total);
    return 0;
}
//  [c]
#include <stdio.h>
//#include <string.h>

int main(void){
  
  int H,W;
  int h,w;
  
  scanf("%d %d", &H, &W);
  scanf("%d %d", &h, &w);

  printf("%d", (H-h)*(W-w));

  return 0;
}
//  [javascript]
function Main(input) {
    const inputs = input.split('\n');
    const whiteH = Number(inputs[0].split(' ')[0]);
    const whiteW = Number(inputs[0].split(' ')[1]);
    const blackH = Number(inputs[1].split(' ')[0]);
    const blackW = Number(inputs[1].split(' ')[1]);

    console.log(whiteH * whiteW - (blackH * whiteW + blackW * whiteH) + (blackW * blackH));
};

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
// inputに入力データ全体が入る
function Main(input) {
  var H,W,h,w;
  H = Number(input.split('\n')[0].split(' ')[0]);
  W = Number(input.split('\n')[0].split(' ')[1]);
  h = Number(input.split('\n')[1].split(' ')[0]);
  w = Number(input.split('\n')[1].split(' ')[1]);

  console.log((H-h)*(W-w));
  
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
	input = input.trim();
  var H = parseInt(input.split("\n")[0].split(" ")[0]);
  var W = parseInt(input.split("\n")[0].split(" ")[1]);
  var h = parseInt(input.split("\n")[1].split(" ")[0]);
  var w = parseInt(input.split("\n")[1].split(" ")[1]);
  console.log((H - h) * (W - w));
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input){
  input=input.trim().split(/\s+/).map(x=>x-0);
  console.log((input[0]-input[2])*(input[1]-input[3]));
}

Main(require("fs").readFileSync('/dev/stdin','utf8'));
//  [javascript]
// inputに入力データ全体が入る
function Main(input) {
	// 1行目がinput[0], 2行目がinput[1], …に入る
  input = input.split("\n")
  tmp0 = input[0].split(" ")
  tmp1 = input[1].split(" ")
  H = tmp0[0]
  W = tmp0[1]
  h = tmp1[0]
  w = tmp1[1]
  var ans = 0;
  console.log((H-h) * (W-w))
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
// Main("3 2\n2 1\n")
//  [javascript]
'use strict'

function Main(input){
	let temp = input.trim().split("\n");
	let temp2 = temp[0].split(" ");
	let H = parseInt(temp2[0]);
	let W = parseInt(temp2[1]);
	
	temp2 = temp[1].split(" ");
	let h = parseInt(temp2[0]);
	let w = parseInt(temp2[1]);

	let sum = H*W;

	sum = sum - ( h*W + H*w ) + h*w;
	
	console.log(sum);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

import "fmt"

func main() {
	var h,w, a,b int
	fmt.Scan(&h, &w, &a,&b)
	fmt.Println((h-a) * (w-b))
}
//  [go]
package main

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

var sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)

func scanString() string   { sc.Scan(); return sc.Text() }
func scanRunes() []rune    { return []rune(scanString()) }
func scanInt() int         { a, _ := strconv.Atoi(scanString()); return a }
func scanInt64() int64     { a, _ := strconv.ParseInt(scanString(), 10, 64); return a }
func scanFloat64() float64 { a, _ := strconv.ParseFloat(scanString(), 64); return a }

func scanInts(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = scanInt()
	} 
	return res
}

func debug(a ...interface{}) { fmt.Fprintln(os.Stderr, a...) }

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}
func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

//•*¨*•.¸¸♪main•*¨*•.¸¸♪(　-ω-)ノ　(　・ω・)
func main() {
	defer wr.Flush()
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 10000), 1001001)

	H := scanInt()
	W := scanInt()
	h := scanInt()
	w := scanInt()

	fmt.Fprintln(wr, (H-h)*(W-w))
}
//  [go]
package main

import (
	"fmt"
)

func main() {
	var H, W, h, w int
	fmt.Scan(&H, &W, &h, &w)

	fmt.Println(H*W - (h*W + H*w - h*w))
}
//  [go]
package main

import (
	"fmt"
)

func main() {

	var H, W, h, w int
	fmt.Scan(&H, &W, &h, &w)
	fmt.Println((H - h) * (W - w))
}
//  [ruby]
h0, w0 = gets.split.map(&:to_i)
h1, w1 = gets.split.map(&:to_i)
puts (h0 - h1) * (w0 - w1)
//  [ruby]
row, column = gets.chomp.split(" ").map(&:to_i)
h, w = gets.chomp.split(" ").map(&:to_i)
puts row*column - (h*column + w*row - h*w)
//  [ruby]
H,W=gets.split.map(&:to_i)
h,w=gets.split.map(&:to_i)

p (H - h) * (W - w)
//  [ruby]
a,b,c,d=`dd`.split.map(&:to_i)
p (a-c).*b-d
//  [ruby]
input = readlines()

h, w = input.shift().chomp.split("\s").map{|x| x.to_i}
th, tw = input.shift().chomp.split("\s").map{|x| x.to_i}

puts (h - th) * (w - tw)
//  [ruby]
h,w = gets.split.map(&:to_i)
x,y = gets.split.map(&:to_i)

puts ((h-x) * (w-y))
//  [rust]
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)*}
    };
}

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)*}
    };
}

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")
    };
}

fn main(){

    input!{
        H: usize,
        W: usize,
        h: usize,
        w: usize,
    }

    println!("{}", H*W+h*w-h*W-H*w);

}
//  [rust]
macro_rules! read_line {
    () => {{
        let mut input = String::new();
        std::io::stdin().read_line(&mut input).unwrap();
        input
    }};
}
pub fn read_to_vec<T: std::str::FromStr>() -> Vec<T> {
    read_line!().split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}
macro_rules! bind_from_vec {
    ( $($variable:ident),+ = $vector:expr ) => {
        let mut v = $vector.clone().into_iter();
        $(let $variable = v.next().unwrap();)+
    };
}
fn main() {
    bind_from_vec!(height, width = read_to_vec::<usize>());
    bind_from_vec!(h, w = read_to_vec::<usize>());

    println!("{}", height * width + h * w - h * width - w * height);
}
//  [rust]
use std::io::*;
use std::str::FromStr;
 
/* 
The read function reads a string according to each one. 
*/
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")
}


//main function
fn main() {
    let hm: i32 = read();
    let wm: i32 = read();
    let h: i32 = read();
    let w: i32 = read();
    println!("{}",hm*wm-h*wm-w*hm+w*h);
}
//  [rust]
use proconio::{fastout, input};

#[fastout]
fn main() {
    input! {
        h: usize,
        w: usize,
        hb: usize,
        wb: usize
    };

    println!("{}", h * w - (h * wb + w * hb - hb * wb));
}
//  [rust]
#![allow(non_snake_case)]

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 H: usize = iterator.next().unwrap().parse().unwrap();
    let W: usize = iterator.next().unwrap().parse().unwrap();
    let h: usize = iterator.next().unwrap().parse().unwrap();
    let w: usize = iterator.next().unwrap().parse().unwrap();

    let ans = (H - h) * (W - w);
    return ans.to_string();
}
//  [swift]
import Foundation

extension String {
    func split(separator: String) -> [Int] {
        return self.componentsSeparatedByString(separator).map { Int($0)! }
    }
}

let input1 = readLine()!.split(" ")
let H = input1[0]
let W = input1[1]
let input2 = readLine()!.split(" ")
let h = input2[0]
let w = input2[1]

print((H-h)*(W-w))
//  [typescript]
import * as fs from 'fs';

//in
//
//out
//
const main = (inp: string) => {

    const h: number = parseInt(inp.split('\n')[0].split(' ')[0]);
    const w: number = parseInt(inp.split('\n')[0].split(' ')[1]);
    const hh: number = parseInt(inp.split('\n')[1].split(' ')[0]);
    const ww: number = parseInt(inp.split('\n')[1].split(' ')[1]);
    console.log((h - hh) * (w - ww));
};

main(fs.readFileSync('/dev/stdin', 'utf8').trim());
//  [typescript]
function Main(input) {
	let input = input.split("\n");
    let tmp = input[0].split(" ");
	let H = parseInt(tmp[0], 10);
	let W = parseInt(tmp[1], 10);
    tmp = input[1].split(" ");
	let h = parseInt(tmp[0], 10);
	let w = parseInt(tmp[1], 10);
    console.log((H-h) * (W-w));
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [typescript]
"use strict"
let fs = require('fs');
let input = fs.readFileSync("/dev/stdin", "utf8").split(/\s/);
let white = ( +input[0] - +input[2] ) * ( +input[1] - +input[3]);
console.log(white);
//  [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 async getNumbers(): Promise<number[]> {
      return (await this.getLine()).split(' ').map((x) => +x);
    }

    public async getStrings(): Promise<string[]> {
      return (await this.getLine()).split(' ');
    }

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

  async function solve() {
    const sc = new Scanner();
    const [H, W]: number[] = await sc.getNumbers();
    const [h, w]: number[] = await sc.getNumbers();

    console.log((H - h) * (W - w));
    sc.close();
  }

  solve();
}
//  [typescript]
((input: string): void => {
    const [[o, p], [q, r]]: number[][] = input.trim().split(/\n/).map(
        (i: string): number[] => { return i.split(" ").map(Number) }
    );
    console.log((o-q) * (p-r));
})(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [typescript]
const main = (input) => {
  const [head, next] = input.split("\n")
  const [W, H] = head.split(" ")
  const [ww, hh] = next.split(" ")
  return (W - ww) * (H - hh)
}

if (process.env.NODE_ENV !== "test") {
  const input = require("fs").readFileSync("/dev/stdin", "utf8")
  console.log(main(input.trim()))
}
//  [python]
import numpy as np
(a,b) = list(map(int,input().split()))
if a>9: 
    print(-1)
    exit(0)
if b>9:
    print(-1)
    exit(0)

print(a*b)
//  [python]
#gcdは3.4.3だとfractionsにある
from fractions import gcd

from math import factorial as f

from math import ceil,floor,sqrt

from sys import exit

from copy import deepcopy
import numpy as np

import bisect
import re


ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))



def main():
    a,b = mi()
    if a>9 or b > 9:
        print(-1)
    else:
        print(a*b)


main()
//  [python]
import numpy as np


def main():
	A, B = [int(x) for x in input().split()]
	
	if 9 < A:
		print(-1)
		return

	if 9 < B:
		print(-1)
		return

	print(A*B)

if __name__ == "__main__":
	main()
//  [java]
import java.util.Scanner;
import java.util.stream.Stream;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str  = sc.nextLine();
        String[] astr = str.split(" "); //状況に合わせて
        Boolean flag  = true;
        int[] in_data = Stream.of(astr).mapToInt(x->{
            try{
                return Integer.parseInt(x);
            }
            catch(Exception e){
                e.printStackTrace();
            }
            return 0;
        }).toArray();
        sc.close();
        int a = in_data[0];
        int b = in_data[1];
        int ans = 0;

        if(a > 9 || b > 9){
            ans = -1;
            System.out.println(ans);
        }
        else{
            ans = a * b;
            System.out.println(ans);
        }

    }

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


int main()
{
    // cout << "A.cpp" << endl;

    int A, B;
    int multi;

    // 入力
    scanf("%d %d", &A, &B);

    if( A <= 9 && B <= 9 ) {
        multi = A * B;
    }
    else {
        multi = -1;
    }

    cout << multi << endl;

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

int main()
{
    int a, b, c;
    scanf("%d %d", &a, &b);
    if(a>0&&a<10&&b>0&&b<10)
        printf("%d", a * b);
    else
        printf("%d", -1);
    return 0;
}
//  [c]
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

int main(void) {
  int A,B;
  scanf("%d %d", &A,&B);
  
  if(A>9 || B>9)
  {
    printf("%d",-1);
  }else{
  	printf("%d",A*B);
  }
}
//  [c]
#include "stdio.h"

int main(){
  int x,y;
  scanf("%d %d",&x,&y);
  if(x<=9&&y<=9){printf("%d",x*y);}
  else{ printf("-1");}
  return 0;
}
//  [javascript]
"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const A = parseInt(arg[0].split(" ")[0]);
    const B = parseInt(arg[0].split(" ")[1]);
    
    if(A >= 10 || B >= 10) {
        console.log(-1);
        return;
    }
    
    if(A <= 0 || B <= 0) {
        console.log(-1);
        return;
    }
    
    console.log(A * B);
    
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
"use strict";
var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split("\n");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]==="string")s[y]=s[y].split(" ").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(" ");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(" "));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();
var o=GET(require("fs").readFileSync("/dev/stdin","utf8"));
function xArray(v){var a=arguments,l=a.length,r="Array(a["+--l+"]).fill(0).map(x=>{return "+v+";})";while(--l)r="Array(a["+l+"]).fill(0).map(x=>"+r+")";return eval(r);}

console.log(main());
function main(){
  var a = o.a();
  var b = o.a();
  if(Math.max(a,b)>9)return -1;
  return a*b;
}
//  [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();1<=e&&e<=9&&1<=n&&n<=9?console.log(e*n):console.log(-1)}}]);
//  [go]
package main

import "fmt"

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

	if a > 9 || b > 9 || a < 0 || b < 0{
		fmt.Println(-1)
	} else{
		fmt.Println(a * b)
	}
}
//  [go]
package main

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

func main() {
	A, B := getStdinInt2()

	if A >= 10 || B >= 10 {
		fmt.Printf("%d\n", -1)
		return
	}
	fmt.Printf("%d\n", A*B)
}

var sc = bufio.NewReaderSize(os.Stdin, 1024*1024*10)

func getStdin() string {
	return readLine()
}
func getStdinInt() int {
	str := getStdin()
	rtn, _ := strconv.Atoi(str)
	return rtn
}
func getStdinInt2() (int, int) {
	list := getStdinIntArr()
	return list[0], list[1]
}
func getStdinInt3() (int, int, int) {
	list := getStdinIntArr()
	return list[0], list[1], list[2]
}
func getStdinInt64() int64 {
	str := getStdin()
	rtn, _ := strconv.ParseInt(str, 10, 64)
	return rtn
}
func getStdinIntU64() uint64 {
	str := getStdin()
	rtn, _ := strconv.ParseInt(str, 10, 64)
	return uint64(rtn)
}
func getStdinInt64_2() (int64, int64) {
	list := getStdinIntArr64()
	return list[0], list[1]
}
func getStdinInt64_3() (int64, int64, int64) {
	list := getStdinIntArr64()
	return list[0], list[1], list[2]
}
func getStdinIntArr() []int {
	str := getStdin()
	list := strings.Split(str, " ")
	rtn := make([]int, len(list))
	for idx, val := range list {
		rtn[idx], _ = strconv.Atoi(val)
	}
	return rtn
}
func getStdinIntArr64() []int64 {
	str := getStdin()
	list := strings.Split(str, " ")
	rtn := make([]int64, len(list))
	for idx, val := range list {
		rtn[idx], _ = strconv.ParseInt(val, 10, 64)
	}
	return rtn
}
func getStdinIntArrU64() []uint64 {
	str := getStdin()
	list := strings.Split(str, " ")
	rtn := make([]uint64, len(list))
	for idx, val := range list {
		r, _ := strconv.ParseInt(val, 10, 64)
		rtn[idx] = uint64(r)
	}
	return rtn
}
func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func min64(a, b int64) int64 {
	if a < b {
		return a
	}
	return b
}
func max(a, b int) int {
	if a < b {
		return b
	}
	return a
}
func max64(a, b int64) int64 {
	if a < b {
		return b
	}
	return a
}
func abs(n int) int {
	if n < 0 {
		return -n
	}
	return n
}
func abs64(n int64) int64 {
	if n < 0 {
		return -n
	}
	return n
}
func readLine() string {
	buf := make([]byte, 0, 0)
	for {
		l, p, _ := sc.ReadLine()
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}
//  [ruby]
x,y=gets.split.map &:to_i
if x>=1 &&x<=9 &&y>=1 &&y<=9
  puts x*y
else
  puts -1
end
//  [ruby]
A,B = gets.strip.split.map(&:to_i)
if 1<=A && 1<=B && A<=9 && B<=9
  puts A*B
else
  puts "-1"
end
//  [ruby]
a,b=gets.split.map &:to_i
p [a,b].all?{1<=_1&&_1<=9} ? a*b : -1
//  [rust]

#[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")
    };
}

fn main() {
    input! {
        a: i32,
        b: i32
    }
    println!("{}", if std::cmp::max(a, b) > 9 {-1} else {a * b});
}
//  [rust]
use std::io;
use std::str::FromStr;

fn input_int_tuple() -> (i32, i32) {
    let mut line: String = String::new();
    io::stdin().read_line(&mut line);
    let vec: Vec<i32> = line.split_whitespace().map(|s| s.parse().unwrap()).collect();
    (vec[0], vec[1])
}

fn main() {
    let (a, b) = input_int_tuple();
    if a <= 9 && b <= 9 {
        println!("{}", a * b);
    } else {
        println!("-1");
    }
}
//  [swift]
import Foundation

let imput_num:String = readLine()!

let ab:[String] = imput_num.componentsSeparatedByString(" ")
let a = Int(ab[0])!
let b = Int(ab[1])!

if a < 10 {
  if b < 10 {
    print(a*b)
  } else {
  	print(-1)
  }
} else {
  print(-1)
}
//  [swift]
let input = readLine()!.characters.split(" ").map{Int(String($0))!}
let (A, B) = (input[0], input[1])
print(A<=9&&B<=9 ? A*B : -1)
//  [swift]
import Foundation
 
let input_line: String = readLine()!
let split: [String] = input_line.components(separatedBy: " ")
 
var A = Int(split[0])!
var B = Int(split[1])!

if (A <= 9 && B <= 9){
    print(A*B)
}else{
    print("-1")
}
//  [typescript]
{
  const main = (input: string) => {
    const r = reader(input)
    const [a, b] = r.ns()

    if (!(0 <= a && a <= 9 && 0 <= b && b <= 9)) {
      console.log(-1)
      return
    }
    console.log(a * b)
  }

  const reader = (str: string) => {
    const lines = str.trim().split('\n')
    const s = () => lines.shift() || ''
    const n = () => Number(s())

    const ss = () => s().split(' ')
    const ns = () => ss().map(Number)
    const nls = () => lines.map(Number)

    return { lines, s, n, ss, ns, nls }
  }

  const getInput = () => require('fs').readFileSync('/dev/stdin', 'utf8')

  main(getInput())
}
//  [typescript]
function Main(input) {
  let arr = parseInput(input);
  console.log(arr[0].every(n => n < 10) ? arr[0].reduce((ret, n) => ret *= n, 1) : -1)
}

function parseInput(input) {
  const lines = input.trim().split('\n');
  return lines.map(line => line.split(' '));
}

Main(require('fs').readFileSync("/dev/stdin", "utf8"));
//  [typescript]
function main(input) {
    const [a,b] = input.split(" ")
    const A = parseInt(a)
    const B = parseInt(b)
    if(A > 9 || B> 9) {
        console.log(-1)
        return
    } 

    console.log(A * B)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [python]
# coding: utf-8
# submission # - User: herp_sy
# https://atcoder.jp/contests/
#
# lang: Python3 (3.4.3)

import math
import statistics
import numpy as np
import queue

n = int(input())
s = input()
ans = 1

for p in range(1, n):
  if s[p - 1] != s[p]:
    ans += 1
print(ans)
//  [python]
n = int(input())
s = input()
for i in range(n-1):
  if s[i] == s[i+1]:
    s = s[:i] + " " + s[i+1:]
print(len(s.replace(" ", "")))
//  [python]
N = int(input())
S = input()

for i in range(N - 1):
    if S[i] == S[i + 1]:
        S = S[:i] + '_' + S[i + 1:]

print(len(S.replace('_', '')))
//  [java]
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        String s = sc.next();
        char[] S = s.toCharArray();
        int counter = 0;
        char temp = S[0];
        for (int i=1; i<N; i++) {
            if (S[i]==temp) {
                S[i] = ' ';
            } else {
                temp = S[i];
            }
        }
        String out = "";
        for (int i=0; i<N; i++) {
            if (S[i]!=' ') {
                out += S[i];
            }
        }
        System.out.println(out.length());
    }
}