jiahuimbzuai/CoQuIR huggingface dataset:
//  [javascript]
process.stdin.resume();
process.stdin.setEncoding('utf8');

var lines = []
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});

reader.on('line', (line) => {
  lines.push(line);
});

reader.on('close', () => {
  var nab = lines[0].split(' ');
  var n = Number(nab[0]);
  var a = Number(nab[1]);
  var b = Number(nab[2]);
  var pass = 0;
  var ab = 1;

  var info = lines[1].split('');
  for(i=0; i<n; i++){
    switch(info[i]){
      case 'a':
        if(pass < a+b){
          console.log("Yes");
          pass++;
          break;
        }else{
          console.log("No")
          break;;
        }
      case 'b':
        if(pass < a+b && b >= ab){
          console.log("Yes");
          pass++;
          ab++;
          break;
        }else{
          console.log("No");
          break;
        }
      case 'c':
        console.log("No");
        break;
    }
  }
});
//  [go]
package main

import "fmt"

func main() {
	var N, A, B int
	var S string
	fmt.Scan(&N, &A, &B, &S)
	x := 0
	y := 0
	for i := 0; i < len(S); i++ {
		switch string(S[i]) {
		case "a":
			if x < A+B {
				fmt.Println("Yes")
				x++
			} else {
				fmt.Println("No")
			}
		case "b":
			y++
			if x < A+B && y <= B {
				fmt.Println("Yes")
				x++
			} else {
				fmt.Println("No")
			}
		case "c":
			fmt.Println("No")
		}
	}
}
//  [go]
package main

import "fmt"

func main() {
	var N, A, B,  na, nb int
	var S string
	fmt.Scan(&N, &A, &B)
	fmt.Scan(&S)
	s := []byte(S)
	for i := 0; i < N; i++ {
		switch s[i] {
		case 'a':
			if A + B > na + nb {
				fmt.Println("Yes")
			}else{
				fmt.Println("No")
			}
			na++
		case 'b':
			if A + B > na + nb && B > nb{
				fmt.Println("Yes")
				nb++
			}else{
				fmt.Println("No")
			}
		case 'c':
			fmt.Println("No")
		}
	}
}

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
}
//  [go]
package main

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

type Scanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewScanner() *Scanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1000)
	return &Scanner{r:rdr}
}
func (s *Scanner) Next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *Scanner) NextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *Scanner) NextInt() int {
	v, _ := strconv.Atoi(s.Next())
	return v
}
func (s *Scanner) NextInt64() int64 {
	v, _ := strconv.ParseInt(s.Next(), 10, 64)
	return v
}

func (s *Scanner) NextIntArray() []int {
	s.pre()
	start := s.p
	result := []int{}
	for ; s.p < len(s.buf) + 1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)
			result = append(result, int(v))
			start = s.p + 1
		}
	}

	return result
}
func (s *Scanner) NextInt64Array() []int64 {
	s.pre()
	start := s.p
	result := []int64{}
	for ; s.p < len(s.buf) + 1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)
			result = append(result, v)
			start = s.p + 1
		}
	}
	return result
}

func (s *Scanner) NextMap() map[int]bool {
	s.pre()
	start := s.p
	mp := map[int]bool{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.Atoi(string(s.buf[start:s.p]))
			mp[v] = true
			start = s.p + 1
		}
	}
	v, _ := strconv.Atoi(string(s.buf[start:s.p]))
	mp[v] = true

	return mp
}

func (s *Scanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *Scanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}

func main() {
	sc := NewScanner()
	N, A, B := sc.NextInt(), sc.NextInt(), sc.NextInt()
	S := sc.NextLine()

	b := 0
	a := 0
	total := 0
	for i := 0; i < N; i++ {
		if S[i] == 'a' {
			a++
			if total < A + B {
				fmt.Println("Yes")
				total++
			} else {
				fmt.Println("No")
			}
		} else if S[i] == 'b' {
			if total < A + B && b < B {
				fmt.Println("Yes")
				total++
				b++
			} else {
				fmt.Println("No")
			}
		} else {
			fmt.Println("No")
		}
	}
}
//  [ruby]
n,a,b = gets.split.map(&:to_i)
s = gets.chomp.split('')
fo = 0
tot = 0
s.each do |x|
  case x
    when "a"
    if tot < a+b
      puts :Yes
      tot += 1
    else
      puts :No
    end
   
    when "b"
    if (fo < b) && (tot < a + b)
      puts :Yes
      tot += 1
      fo += 1
    else
      puts :No
    end
    
    when "c"
    puts :No
  end
end
//  [ruby]
n,a,b = gets.chomp.split.map(&:to_i)
f = 0
bf = 0

gets.chomp.split('').each{|x|
    if x == 'a'
        if f < a+b
            f += 1
            puts 'Yes'
        else
            puts 'No'
        end
    elsif x == 'b'
        if f < a+b && bf < b
            f += 1
            bf += 1
            puts 'Yes'
        else
            puts 'No'
        end
    else
        puts 'No'
    end
}
//  [ruby]
num = gets.split(" ")
s = gets.chomp.split("")

x = 0
y = 0
z = 0
num[0] = num[0].to_i
num[1] = num[1].to_i
num[2] = num[2].to_i
repeat = num[0] - 1

for n in 0..repeat do
  if s[n] == "a"
    if num[1] + num[2] > z
      puts "Yes"
      x += 1
    else
      puts "No"
    end
  elsif s[n] == "b"
    if num[1] + num[2] > z && num[2] > y
      puts "Yes"
      y += 1
    else
      puts "No"
    end
  else
    puts "No"
  end 
  z = x + y
end
//  [rust]
pub mod io {
    use std::io;

    pub fn read_line() -> String {
        let mut s = String::new();
        io::stdin().read_line(&mut s).unwrap();
        s.trim_right().to_owned()
    }

    pub trait Read {
        fn read(s: &str) -> Self;
    }

    macro_rules! def_read {
        ($t: ty) => {
            impl Read for $t {
                fn read(s: &str) -> $t {
                    s.parse().unwrap()
                }
            }
        }
    }

    def_read!(i32);
    def_read!(i64);
    def_read!(isize);
    def_read!(usize);
    def_read!(f64);

    impl<T: Read> Read for Vec<T> {
        fn read(s: &str) -> Self { s.split_whitespace().map(|w| T::read(w)).collect() }
    }

    macro_rules! def_read_tuple {
        ($($t: ident),*) => {
            impl<$($t : Read + Default),*> Read for ($($t),*) {
                fn read(s: &str) -> Self {
                    let ws = s.split_whitespace().collect::<Vec<_>>();
                    let mut i = 0;
                    ( $({i += 1; $t::read(ws[i - 1])}),* )
                }
            }
        };
    }

    def_read_tuple!(T0, T1);
    def_read_tuple!(T0, T1, T2);
    def_read_tuple!(T0, T1, T2, T3);
    def_read_tuple!(T0, T1, T2, T3, T4);

    pub fn readln<T: Read>() -> T { T::read(&read_line()) }
}

fn main() {
    let (n, a, b): (i32, i32, i32) = io::readln();
    let s = io::read_line();

    let mut cur = 0;
    let mut abr = 0;

    for c in s.chars() {
        let b = match c {
            'a' => cur < a + b,
            'b' => cur < a + b && abr < b,
            _ => false,
        };

        if b {
            cur += 1;
            if c == 'b' { abr+=1 }
        }

        println!("{}", if b {"Yes"} else {"No"});
    }
}
//  [rust]
use std::str::FromStr;

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

fn get_vec<T : FromStr>() -> Vec<T> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    return s.trim().split_whitespace().map(|e| e.parse().ok().unwrap()).collect();
}

fn main() {
    let v : Vec<i64> = get_vec();
    let (n,a,b) = (v[0], v[1], v[2]);
    let ranks : String = get_one();

    let mut foreign = 0;
    let mut all = 0;
    for c in ranks.chars() {
        if c == 'a' {
            if all < a + b {
                println!("{}", "Yes");
                all += 1;
            }
            else {
                println!("{}", "No");
            }
        }
        else if c == 'b' {
            if all < a + b && foreign < b {
                println!("{}", "Yes");
                all += 1;
                foreign += 1;
            }
            else {
                println!("{}", "No");
            }
        }
        else {
            println!("{}", "No");
        }
    }
}
//  [python]
#106

A, B = map(int, input().rstrip().split())

print(A*B-A-B+1)
//  [python]
a,b = map(int,input().split())
print(a*b-a-b+1)
//  [python]
A, B = map(int, input().split())
print((A-1)*(B-1))
//  [python]
# -*- coding: utf-8 -*-
# 
import math
import sys
import itertools
import numpy as np

# なんこか入力
a,b = map(int, input().split())

print((a-1)*(b-1))
//  [python]
import numpy as np
import math

A, B = map(int, input().split())

print((A-1) * (B-1))
//  [python]
import bisect
import copy
import heapq
import math
import sys
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
sys.setrecursionlimit(500000)
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

a,b=map(int,input().split())
print((a-1)*(b-1))
//  [java]
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int a = Integer.parseInt(str[0]);
    int b = Integer.parseInt(str[1]);
    System.out.println((a-1)*(b-1));
  }
}
//  [java]
import java.util.HashSet;
import java.util.Set;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] line = br.readLine().split(" ");
        int a = Integer.parseInt(line[0])-1;
        int b = Integer.parseInt(line[1])-1;
        System.out.println(a*b);
    }
    
    
}
//  [java]
import java.io.*;
import java.util.*;

public class Main {
	private static final int READ_COUNT = 1;
	private static List<String> strList = new ArrayList<>();
	
	public static void main(String[] args) {
		read();
		
		int a = Integer.parseInt(strList.get(0).split(" ")[0]);
		int b = Integer.parseInt(strList.get(0).split(" ")[1]);
		
		System.out.println((a * b) - (a + b - 1));
	}
	
	private static void read() {
		try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
			for (int i = 0; i < READ_COUNT; i++) {
				strList.add(br.readLine());
			}
		} catch (IOException e) {
		}
	}
}
//  [java]
import java.util.Scanner;

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

		int aa=sc.nextInt();
		int bb=sc.nextInt();
		System.out.println((aa-1)*(bb-1));
	}
}
//  [java]
import java.util.Scanner;

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


import java.util.Scanner;

public class Main {

    static Scanner sc = new Scanner(System.in);


    public static void main(String[] args) {
        int a = sc.nextInt();
        int b = sc.nextInt();
        System.out.println((a - 1) * (b - 1));
    }
}
//  [cpp]
#include <cstdio>

int main() {
  int n, m; scanf("%d%d", &n, &m);
  printf("%d\n", n * m - n - m + 1);
}
//  [cpp]
#include <cstdio>
#include <cstring>
#include <algorithm>
#define ll long long
#define inf 1<<30
#define il inline 
#define in1(a) read(a)
#define in2(a,b) in1(a),in1(b)
#define in3(a,b,c) in2(a,b),in1(c)
#define in4(a,b,c,d) in2(a,b),in2(c,d)
il void readl(ll &x){
    x=0;ll f=1;char c=getchar();
    while(c<'0'||c>'9'){if(c=='-')f=-f;c=getchar();}
    while(c>='0'&&c<='9'){x=x*10+c-'0';c=getchar();}
    x*=f;
}
il void read(int &x){
    x=0;int f=1;char c=getchar();
    while(c<'0'||c>'9'){if(c=='-')f=-f;c=getchar();}
    while(c>='0'&&c<='9'){x=x*10+c-'0';c=getchar();}
    x*=f;
}
using namespace std;
/*===================Header Template=====================*/
#define N 100010
int main(){
	int a,b;
	in2(a,b);
	printf("%d",(a-1)*(b-1));
	return 0; 
}
//  [cpp]
#include<stdio.h>
using namespace std;
int main(){
    int a,b;
    scanf("%d%d",&a,&b);
    int total = a*b;
    printf("%d\n",total-((a+b)-1));
    return 0;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
 
#define fo(i,n) for(i=0;i<n;i++)
#define Fo(i,k,n) for(i=k;i<n;i++)
#define ll long long
 
#define pb push_back
#define mp make_pair
#define F first
#define S second
 
#define fastIO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
 
#define debug(x) cout<<#x<<" :: "<<x<<"\n";
#define debug2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\n";
#define debug3(x,y,z) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<"\n";
 
using namespace std;

/**************************************************************************/
int main()
{
	fastIO;
	ll a,b,c;
	cin>>a>>b;
	c = a + b - 1;
	cout<<a*b-c;
}/*************************************************************************/
//  [cpp]
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧  
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     
　　　　／　　　＼　 　  |　|     
　　　 /　　 /￣￣￣￣/　　|  
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿  
　 　　　＼/＿＿＿＿/　（u　⊃  
---------------------------------------------------------------------------------------------------*/
int A, B;
//---------------------------------------------------------------------------------------------------
void _main() {
    cin >> A >> B;
    int ans = (A - 1) * (B - 1);
    cout << ans << endl;
}
//  [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 a,b;
  cin>>a>>b;
  int ans=a*b-a-b+1;
  cout(ans);
  return 0;
}
//  [c]
#include<stdio.h>
int main()
{
int a,b;
scanf("%d%d",&a,&b);
printf("%d",((a*b)-a-b+1));
return 0;
}
//  [c]
#include <stdio.h>

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

int main(int argc, char const *argv[]) {
	char str[101];
	int n, m;

	fgets(str, 100, stdin);
	sscanf(str, "%d %d\n", &n, &m);

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

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

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

function Main(INPUT) {
    const N = INPUT.split(" ").map(n => Number(n));
    console.log((N[0] - 1) * (N[1] - 1));
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
inp = require('fs').readFileSync('/dev/stdin', 'utf8').split('\n')
l = inp.shift().split(' ')
A = l[0] * 1 - 1
B = l[1] * 1 - 1
console.log(A * B)
//  [javascript]
'use strict';

function Main(input) {
  const A = input.split(' ')[0];
  const B = input.split(' ')[1];

  console.log((A-1) * (B-1));

  
};

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
//  [javascript]

const Main = (input) => {
    const A = input.split(' ')[0];
    const B = input.split(' ')[1];
    console.log(A * B - A - B + 1)
}


//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
// parameter "input" gets all data
function Main(input) {
	// the first line is assigned to input[0], the second line is assigned to input[1] similarly.
	input = input.split(" ");
	// convert string from integer using "parseInt"
	var a = parseInt(input[0], 10);
	var b = parseInt(input[1], 10);
	//output
	console.log('%d',a*b-a-b+1);
}
// Don't edit this line!


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

import "fmt"

func main() {
	var A, B int
	fmt.Scan(&A, &B)
	fmt.Println((A - 1) * (B - 1))
}
//  [go]
package main

import (
	"fmt"
)

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

	fmt.Println(a*b - (a + b - 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)
	a, b := intScanner(), intScanner()
	fmt.Println((a - 1) * (b - 1))
}
//  [go]
package main

import (
	"fmt"
)

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

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

func main() {
	r := bufio.NewReader(os.Stdin)
	s, _ := r.ReadString('\n')
	s = strings.TrimRight(s, " \t\n")
	slice := strings.Split(s, " ")
	a := string(slice[0])
	b := string(slice[1])
	A, _ := strconv.Atoi(a)
	B, _ := strconv.Atoi(b)

	fmt.Println((A - 1) * (B - 1))
}
//  [ruby]
a,b=gets.split.map(&:to_i)
puts a*b-a-b+1
//  [ruby]
a,b=gets.split.map(&:to_i); p (a - 1) * (b - 1)
//  [ruby]
a, b = gets.split(" ").map(&:to_i)
puts (a-1) * (b-1)
//  [ruby]
a, b = gets.split.map &:to_i
p (a-1)*(b-1)
//  [ruby]
a,b=gets.split.map &:to_i
puts (a-1)*(b-1)
//  [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

puts A * B - (A + B - 1)
//  [rust]
use std::io::*;
use std::str::FromStr;

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

fn main() {
    let a: usize = read();
    let b: usize = read();
    println!("{}", (a - 1) * (b - 1));
}
//  [rust]
use std::io::Read;

fn main() {
    let mut buf = String::new();

    std::io::stdin().read_to_string(&mut buf).unwrap();

    let mut iter = buf.split_whitespace();
    let a: usize = iter.next().unwrap().parse().unwrap();
    let b: usize = iter.next().unwrap().parse().unwrap();
    println!("{}", (a - 1) * (b - 1));
}
//  [rust]
use std::io;

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

fn main() {
	let v:Vec<i32> = procon_read();
	let a = v[0];
	let b = v[1];
	println!("{}", (a-1)*(b-1));
}
//  [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 a: usize = iterator.next().unwrap().parse().unwrap();
    let b: usize = iterator.next().unwrap().parse().unwrap();

    let ans = a * b - a - b + 1;
    return ans.to_string();
}
//  [rust]
#![allow(non_snake_case)]
#![allow(unused_imports)]
use proconio::input;
use std::cmp::max;
use std::cmp::min;
use std::collections::HashMap;
use std::collections::VecDeque;

fn main() {
    input! {
        A: i64,
        B: i64,
    }

    let ans = A * B - A - B + 1;
    println!("{}", ans);
}
//  [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!{
        a: [u32; 2],
    }
    println!("{}", a[0] * a[1] - a[0] - a[1] + 1);
}
//  [typescript]
import * as fs from 'fs';

namespace AtCoder.abc106 {

    class ProgramA {
        args: string[];

        constructor(args: string[]) {
            this.args = args;
        }

        /**
         * in
         * 5 7
         * out
         * 24
         */
        main(): void {
            const [a, b]: number[] = this.args[0].split(' ').map(Number);
            // 35
            // 5+7-1
            console.log(a * b - (a + b - 1));
        }
    }

    const args = fs.readFileSync('/dev/stdin', 'utf8').trim().split('\n');
    const prg = new ProgramA(args);
    prg.main();
}
//  [typescript]
const stdin = require('fs').readFileSync('/dev/stdin', 'utf8')

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

const res = (a-1)*(b-1)

console.log(res)
//  [typescript]
function main(input) {
const A  = parseInt(input.split(/\n|\s/g)[0],10);
const B  = parseInt(input.split(/\n|\s/g)[1],10);
console.log((A-1)*(B-1))
}
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 [A, B] = input[0].map(Number);

  return (A - 1) * (B - 1);
};

console.log(main(read()));
//  [typescript]
function readLines(): Promise<string[]> {
    return new Promise<string[]>((resolve) => {
        let inputBuffer = "";
        process.stdin.resume();
        process.stdin.setEncoding("utf8");
        process.stdin.on("data", (chunk) =>
            inputBuffer += chunk.toString()
        );
        process.stdin.on("end", () =>
            resolve(inputBuffer.split("\n"))
        );
    });
}

async function main() {
    const inputs: string[] = await readLines();
    const sp = inputs[0].split(" ");
    const a = parseInt(sp[0]);
    const b = parseInt(sp[1]);
    console.log((a-1)*(b-1));
}

main();
//  [typescript]
const main = (input) => {
  input = input.split(' ');
  const a = parseInt(input[0], 10);
  const b = parseInt(input[1], 10);
  
  console.log((a-1)*(b-1));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [python]
a,b=map(int,input().split())
if a<=0 and b>=0:
    print("Zero")
    exit()
if a>0:
    print("Positive")
    exit()
tmp=0
for i in range(a,b+1):
    tmp+=1
if tmp%2==0:
    print("Positive")
else:
    print("Negative")
//  [python]
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    A,B=MI()
    if(A*B<=0):
        print("Zero")
    else:
        if(A>0):
            print("Positive")
        else:
            if((B-A+1)&1):
                print("Negative")
            else:
                print("Positive")

if __name__ == '__main__':
    main()
//  [python]
a,b = map(int, input().split())
if (a <= 0 and b >= 0):
    print ("Zero")
    exit()
if (a < 0 and b < 0):
    diff = b - a + 1
    if (diff % 2 == 0):
        print ("Positive")
    else:
        print ("Negative")
    exit()
if (a > 0 and b > 0):
    print ("Positive")
    exit()
//  [java]
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long a = sc.nextLong();
    long b = sc.nextLong();
    int negative_count = 0;
		for(long i = a; i <= b; i++) {
			if(i==0) {
				System.out.println("Zero");
				return;
			}
			if(i < 0) {
				negative_count++;
			}
		}
		if(negative_count%2 == 0) {
			System.out.println("Positive");
		}
		else {
			System.out.println("Negative");
		}
	}
}
//  [java]
    import java.util.Scanner;
    
    public class Main{
    public static void main(String args[]){
    int a = 0;
    int b = 0;
    int n = 1;
    Scanner scan = new Scanner(System.in);
    
    a=scan.nextInt();
    b=scan.nextInt();
    
    if(a<=0 && b>=0){
    	System.out.println("Zero");
    }else if(a>0){
    	System.out.println("Positive");
    }else{
    	for(int i=a;i<=b;i++){
    		n=n*(-1);
    	}
    	if(n<0){
    		System.out.println("Negative");
    	}else{
    		System.out.println("Positive");
    	}
    }

    }
}
//  [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();

		int minus = 0;
		boolean zero = false;
		for (int i = a; i <= b; i++) {
			if (i < 0) minus++;
			if (i == 0) zero = true;
		}

		if (zero) {
			System.out.println("Zero");
		} else if (minus % 2 == 0) {
			System.out.println("Positive");
		} else {
			System.out.println("Negative");
		}

		sc.close();
	}

}
//  [cpp]
#include <iostream>

using namespace std;

int main()
{
	int a, b;
	cin >> a >> b;
	bool zero = false;
	bool puls = true;

	if (a < 0)
	{
		for (int i = a; i <= b; i++)
		{
			if (i == 0)
			{
				zero = true;
			}
			if (i < 0)
			{
				puls = !puls;
			}
		}
	}
	if (zero)
	{
		cout << "Zero" << endl;
	}
	else
	{
		if (puls)
		{
			cout << "Positive" << endl;
		}
		else
		{
			cout << "Negative" << endl;
		}
	}
	return 0;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int l, r;

int chk(int x) {
	if(x < 0) return -1;
	else if(x > 0) return 1;
	else return 0;
}

int main() {
	cin >> l >> r;
	int ans = 1;
	for(int i = l; i <= r; i++) {
		ans *= chk(i);
	}
	if(ans < 0) puts("Negative");
	else if(ans > 0) puts("Positive");
	else puts("Zero");
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

template <typename T> int sgn(T val) {
    return (T(0) < val) - (val < T(0));
}

void solve(long long a, long long b){
    int s = 1;
    for (int i = a; i <= b; i++)
    {
        s *= sgn(i);
    }
    string ans;
    if(s>0) ans = "Positive";
    else if(s<0) ans = "Negative";
    else ans = "Zero";
    std::cout << ans << endl;
}

int main(){
    long long a;
    scanf("%lld",&a);
    long long b;
    scanf("%lld",&b);
    solve(a, b);
    return 0;
}
//  [c]
b,i;main(s){scanf("%d%d",&i,&b);for(;i<=b;++i){if(i<0)++s;else if(i==0)break;}b=!puts((i<=b)?"Zero":((s&1)?"Positive":"Negative"));}
//  [c]
a,b,i;main(s){scanf("%d%d",&a,&b);for(i=a;i<=b;++i){if(i<0)++s;else if(i==0){puts("Zero");exit(0);}}a=!puts((s & 1) ?"Positive" : "Negative");}
//  [c]
a,b,i;main(s){scanf("%d%d",&a,&b);for(i=a;i<=b;++i){if(i<0)++s;else if(i==0)break;}a=!puts((i<=b)?"Zero":((s&1)?"Positive":"Negative"));}
//  [javascript]
const inf = Number.MAX_SAFE_INTEGER;
function Main(input){
	var mem = input.split(" ").map(Number);
	var n = Math.abs(mem[0]-mem[1])+1;
	var a=0,b=0;
	if(mem[0]>0) a = 1;
	else if(mem[0]<0) a= -1;
	if(mem[1]>0) b = 1;
	else if(mem[1]<0) b= -1;
	if(a==0||b==0||a!=b) console.log("Zero");
	else{
		if(a==-1&&b==-1&&n%2==1) console.log("Negative");
		else console.log("Positive");
	}
}Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
//  [javascript]
process.stdin.resume();
process.stdin.setEncoding('utf8');

var lines = [];
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
reader.on('line', (line) => {
  lines.push(line);
});
reader.on('close', () => {
    const [a,b] = lines[0].split(" ").map(v=>v-0);
    if(a*b<=0) console.log("Zero");
    else if(b<0){
        console.log((b-a+1)%2===0?"Positive":"Negative");
    }else{
        console.log("Positive");
    }
    
});
//  [javascript]
"use strict";
const Main = (input) =>{
   let xs = input.trim().split(' ').map(v=>parseInt(v,10));
   
   //let ans =(xs[0]+xs[1])%2
   //console.log(ans)
  
   if(xs[0]>0 && xs[1]>0){
   console.log('Positive')
   }else if(xs[0]<0 && xs[1]>0){
   console.log('Zero')
   }else if((xs[0]+xs[1])%2 ==-1){
   console.log('Positive')
   }else if((xs[0]+xs[1])%2 ==0){
   console.log('Negative')
   }
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));
//  [go]
package main

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

var sc = bufio.NewScanner(os.Stdin)

func scanInt() int {
	num, _ := strconv.Atoi(scanString())
	return num
}

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

func scanInts(n int) []int {
	sl := make([]int, n)
	for i := range sl {
		sl[i] = scanInt()
	}
	return sl
}

func init() {
	sc.Split(bufio.ScanWords)
}

func main() {
	a, b := scanInt(), scanInt()
	var cnt int
	for i := a; i <= b; i++ {
		if i < 0 {
			cnt++
		}
		if i == 0 {
			fmt.Println("Zero")
			return
		}
		if i > 0 {
			break
		}
	}
	if cnt%2 == 0 {
		fmt.Println("Positive")
	} else {
		fmt.Println("Negative")
	}
}

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
}

func abs(n int) int {
	if n < 0 {
		return -n
	}
	return n
}
//  [go]
package main

import (
	"fmt"
)

func main() {
	var a, b int
	fmt.Scanf("%d %d", &a, &b)
	ps := 1
	for i := a; i <= b; i++ {
		if i < 0 {
			ps *= -1
		} else if i == 0 {
			ps *= 0
			break
		} else {
			ps *= 1
		}
	}
	if ps < 0 {
		fmt.Println("Negative")
	} else if ps == 0 {
		fmt.Println("Zero")
	} else {
		fmt.Println("Positive")
	}
}
//  [go]
package main

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

func main() {
	sc = initScanner(os.Stdin)
	a, b := scanInt(sc), scanInt(sc)
	fmt.Println(resolve(a, b))
}

func resolve(a, b int) string {
	if a == b {
		if a < 0 {
			return "Negative"
		}
	}

	if a <= 0 && b >= 0 {
		return "Zero"
	}
	if a > 0 && b > 0 {
		return "Positive"
	}

	count := 0
	for i := a; i <= b; i++ {
		count++
	}

	if count%2 == 0 {
		return "Positive"
	} else {
		return "Negative"
	}

}

// --------------- BASE DEFINITIONS ---------------

const (
	initialBufSize = 100000
	maxBufSize     = 1000000
)

var sc *bufio.Scanner

func initScanner(r io.Reader) *bufio.Scanner {
	buf := make([]byte, initialBufSize)

	sc := bufio.NewScanner(r)
	sc.Buffer(buf, maxBufSize)
	sc.Split(bufio.ScanWords)
	return sc
}

func scanInt(sc *bufio.Scanner) int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return i
}

func scanIntSlice(sc *bufio.Scanner, n int) []int {
	is := make([]int, n)
	for i := 0; i < n; i++ {
		is[i] = scanInt(sc)
	}

	return is
}

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

func scanStringSlice(sc *bufio.Scanner, n int) []string {
	ss := make([]string, n)
	for i := 0; i < n; i++ {
		sc.Scan()
		ss[i] = sc.Text()
	}

	return ss
}
//  [ruby]
a, b = gets.split(" ").map(&:to_i)

if a > 0
    puts "Positive"
elsif a <= 0 and b > 0
    puts "Zero"
else
    if (b - a).abs % 2 == 1
        puts "Positive"
    else
        puts "Negative"
    end
end
//  [ruby]
a,b = gets.chomp.split(' ').map(&:to_i)
if a * b <= 0
  puts "Zero"
elsif a > 0
  puts "Positive"
elsif (b - a) % 2 == 0
  puts "Negative"
else
  puts "Positive"
end
//  [ruby]
a, b = gets.split.map &:to_i
if a <= 0 && b >= 0
  puts 'Zero'
elsif a < 0 && b < 0 && (a - b).even?
  puts 'Negative'
else
  puts 'Positive'
end
//  [rust]
use whiteread::parse_line;

fn main() {
    let (a, b): (isize, isize) = parse_line().unwrap();

    if a > 0 {
        println!("Positive");
    } else if b >= 0 {
        println!("Zero");
    } else if (b - a) % 2 == 1 {
        println!("Positive");
    } else {
        println!("Negative");
    }
}
//  [rust]
use proconio::{fastout, input};

#[fastout]
fn main() {
    input! {a: i128, b:i128};
    let mut sum: i128 = 1;

    for i in a..b {
        sum *= i;
    }

    if b < 0 {
        let x = a.abs() - b.abs();
        if x % 2 == 0 {
            println!("Negative")
        } else {
            println!("Positive")
        }
    } else if a < 0 && b > 0 {
        println!("Zero")
    } else {
        let x = a.abs();

        if x % 2 == 0 {
            println!("Negative")
        } else {
            println!("Positive")
        }
    }
}
//  [rust]
#[allow(unused_imports)]
use std::{cmp::Reverse, collections::*};

#[allow(unused_imports)]
use proconio::{
    fastout, input,
    marker::{Chars, Usize1},
};

#[allow(unused_imports)]
use itertools::Itertools;

#[allow(unused_imports)]
use num::Integer;

#[fastout]
pub fn main() {
    input! {
        a: i64, b: i64,
    }
    if a <= 0 && b >= 0 {
        println!("Zero");
    } else if a > 0 {
        println!("Positive");
    } else {
        if (b - a + 1) % 2 == 0 {
            println!("Positive");
        } else {
            println!("Negative");
        }
    }
}
//  [python]
import sys

N = int(sys.stdin.readline())
As = list(map(int, sys.stdin.readline().split()))
res = 1
for A in As:
    if A % 2 == 0:
        res *= 2
print(3**len(As) - res)
//  [python]
N=int(input())
A=list(map(int,input().split()))
e=1
for i in A:
    if i%2==0:
        e*=2#奇数が2パターンある
    else:
        e*=1#奇数が1パターンある
print(3**N-e)#全通り ー 積が奇数の組
//  [python]
n = int(input())
l = [int(i) for i in input().split()]

l = [i for i in l if i % 2 == 0]

print(3 ** n - 2 ** len(l))
//  [python]
# coding: utf-8
# Here your code !
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Oct  9 22:12:40 2017

@author: kitagenbakurou
"""
import numpy as np
import copy

N = input()
N = int(N)
s = input().split()
s = [int(i) for i in s]

cnt = 1
for i in range(N) : 
    if s[i] % 2 == 0 : cnt *= 2
    else : cnt *= 1

print(3 ** N - cnt)
//  [python]
def main():
  import numpy as np
  N = int(input())
  A = list(map(int,input().split()))

  def ternary (n):
      if n == 0:
          return '0'
      nums = []
      while n:
          n, r = divmod(n, 3)
          nums.append(str(r))
      return ''.join(reversed(nums))

  ans = 0
  AA = np.array(A)
  for i in range(3**N):
    I = ternary(i).zfill(N)
    tmp = 1
    for a in range(N):
      if I[a] == "0":
        tmp *= AA[a] - 1
      elif I[a] == "1":
        tmp *= AA[a]
      else:
        tmp *= AA[a] + 1
    if tmp % 2 == 0:
      ans += 1
  print(ans)
main()
//  [python]
import numpy

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

a = numpy.array([2 if i%2==0 else 1 for i in l])

print(3**n - a.prod())
//  [java]
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;

public class Main {

	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);

		int n = sc.nextInt();
		int[] a = sc.nextIntArray(n);

		int o = 1;
		for (int i = 0; i < n; i++) {
			if (a[i] % 2 == 0) o *= 2;
		}

		out.println((int) Math.pow(3, n) - o);
		out.flush();
	}

}

class FastScanner {
	private final InputStream in = System.in;
	private final byte[] buffer = new byte[1024];
	private int ptr = 0;
	private int buflen = 0;

	private boolean hasNextByte() {
		if (ptr < buflen) return true;
		else {
			ptr = 0;
			try {
				buflen = in.read(buffer);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen <= 0) return false;
		}
		return true;
	}

	private byte readByte() {
		if (hasNextByte()) return buffer[ptr++];
		return -1;
	}

	private boolean isPrintableChar(byte c) {
		return '!' <= c && c <= '~';
	}

	private void skipUnprintable() {
		while (hasNextByte() && !isPrintableChar(buffer[ptr])) {
			ptr++;
		}
	}

	public boolean hasNext() {
		skipUnprintable();
		return hasNextByte();
	}

	public String next() {
		if (!hasNext()) throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		byte b = readByte();
		while (isPrintableChar(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	public int nextInt() {
		if (!hasNext()) throw new NoSuchElementException();
		int n = 0;
		boolean minus = false;
		byte b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) throw new NumberFormatException();
		while (true) {
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			} else if (b == -1 || !isPrintableChar(b)) {
				return minus ? -n : n;
			} else {
				throw new NumberFormatException();
			}
			b = readByte();
		}
	}

	public int[] nextIntArray(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = nextInt();
		}
		return a;
	}

	public long nextLong() {
		if (!hasNext()) throw new NoSuchElementException();
		long n = 0;
		boolean minus = false;
		byte b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) throw new NumberFormatException();
		while (true) {
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			} else if (b == -1 || !isPrintableChar(b)) {
				return minus ? -n : n;
			} else {
				throw new NumberFormatException();
			}
			b = readByte();
		}
	}

	public long[] nextLongArray(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++) {
			a[i] = nextInt();
		}
		return a;
	}
}
//  [java]
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int[] A = new int[N];
        for (int i = 0; i < N; i++) {
            A[i] = scan.nextInt();
        }

        int base = (int) Math.pow(3, N);

        int even = (int) IntStream.of(A).filter(a -> a % 2 == 0).count();
        System.out.println(base - (int) Math.pow(2, even));
    }
}
//  [java]
import java.util.*;

class Main {
    public static void main(String[] args) {
        new Solver().run();
    }
}

class Solver {

    private void gen(int i, List<List<Integer>> res, List<Integer> cur, int N, int[] A) {
        if (cur.size() == N) {
            res.add(cur);
            return;
        }

        List<Integer> v1 = new ArrayList<Integer>(cur);
        v1.add(A[i] - 1);
        gen(i + 1, res, v1, N, A);

        List<Integer> v2 = new ArrayList<Integer>(cur);
        v2.add(A[i]);
        gen(i + 1, res, v2, N, A);

        List<Integer> v3 = new ArrayList<Integer>(cur);
        v3.add(A[i] + 1);
        gen(i + 1, res, v3, N, A);
    }


    public void run() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] A = new int[N];

        for (int i = 0; i < N; i++) {
            A[i] = sc.nextInt();
        }

        int cnt = 0;
        List<List<Integer>> result = new ArrayList<List<Integer>>();
        gen(0, result, new ArrayList<Integer>(), N, A);
        for (List<Integer> l : result) {
            long sum = 1;
            for (Integer v :l)  {
                sum *= v;
            }
            if (sum % 2 == 0) cnt++;
        }
        System.out.println(cnt);

        return;
    }

}
//  [cpp]
#include <cstdio>
#include <vector>

int main() {
  int N;
  scanf("%d", &N);

  int res=1, sub=1;
  for (int i=0; i<N; ++i) {
    int a;
    scanf("%d", &a);
    res *= 3;
    if ((a & 1) == 0) {
      sub *= 2;
    }
  }

  printf("%d\n", res-sub);
  return 0;
}
//  [cpp]
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
const int maxn=100010;
int ans=1,sum=1,n,a[maxn];
void read(int &k){
	k=0; int f=1; char c=getchar();
	while (c<'0'||c>'9')c=='-'&&(f=-1),c=getchar();
	while ('0'<=c&&c<='9')k=k*10+c-'0',c=getchar();
	k*=f;
}
int main(){
    read(n);
    for (int i=1;i<=n;i++) read(a[i]);
    for (int i=1;i<=n;i++) ans*=3;
    for (int i=1;i<=n;i++) if (!(a[i]&1)) sum*=2;
    printf("%d",ans-sum);
	return 0;
}
//  [cpp]
#include<stdio.h>
#include<string.h>
int n,i,a[20],j,s,ans;
int main(){
    scanf("%d",&n);
    ans=1;
    for(i=0;i<n;i++){
        scanf("%d",&a[i]);
        ans*=3;
    }
    s=1;
    for(i=0;i<n;i++) if(a[i]%2==0) s*=2;
    ans-=s;
    printf("%d\n",ans);
}