Problem:


﻿Score: 100 points

Problem Statement

There is a farm whose length and width are A yard and B yard, respectively. A farmer, John, made a vertical road and a horizontal road inside the farm from one border to another, as shown below: (The gray part represents the roads.)

What is the area of this yard excluding the roads? Find it.

Note

It can be proved that the positions of the roads do not affect the area.

Constraints

A is an integer between 2 and 100 (inclusive).

B is an integer between 2 and 100 (inclusive).

Input

Input is given from Standard Input in the following format:

A B

Output

Print the area of this yard excluding the roads (in square yards).

Sample Input 1

2 2

Sample Output 1

1

In this case, the area is 1 square yard.

Sample Input 2

5 7

Sample Output 2

24

In this case, the area is 24 square yards. 



Sample input:
2 2


Sample output:
1

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
#define tr(container, it) \
        for (auto it = container.begin(); it != container.end(); it++)
#define scontains(c, x) ((c).find(x) != (c).end())   //O(log n)
#define contains(c, x) (find((c).begin(),(c).end(),x) != (c).end()) //O(n)
#define ill(_x)  ll _x;scanf("%lld",&_x);
#define idb(_x)  double _x;scanf("%lf",&_x);
#define all(x) (x).begin(),(x).end()
#define pll pair<ll,ll>
#define mll map<ll,ll>
#define vll vector<ll>
#define sll set<ll>
#define vs vector<string>
#define in0(x, a, b)((x)>=a && (x)<=b    )
#define in1(x, a, b)((x)>a && (x)<b)
#define  rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
const double pi = 3.14159265358979323846;
const int INF = 0x3f3f3f3f;
const int X10 = 1024, X11 = 2048, X12 = 4096, X13 = 8196, X14 = 16392, X15 = 32786, X16 = 65536, X17 = 131072, X18 = 262144, X19 = 524288, X20 = 1048576;

class UnionFind {
private:
    vector<int> p, rank;
    int N;
    int findSet2(int i, bool* A){A[i] = 1;return (p[i] == i) ? i : (p[i] = findSet2(p[i], A));}
public:
    UnionFind(int N) {
        rank.assign(N, 0);
        p.assign(N, 0);
        for (int i = 0; i < N; i++) p[i] = i;
        this->N = N;
    }

    int findSet(int i) { return (p[i] == i) ? i : (p[i] = findSet(p[i])); }

    bool isSameSet(int i, int j) { return findSet(i) == findSet(j); }

    void unionSet(int i, int j) {
        if (!isSameSet(i, j)) {
// if from different set
            int x = findSet(i), y = findSet(j);
            if (rank[x] > rank[y]) p[y] = x;
// rank keeps the tree short
            else {
                p[x] = y;
                if (rank[x] == rank[y]) rank[y]++;
            }
        }
    }


    int numDisjointSets(){
        set<int> s;
        bool* visited = new bool[this->N];
        memset(visited, 0, sizeof(bool)*this->N);
        for (int i = 0; i < N; ++i) {
            if(!visited[i])s.insert(findSet2(i, visited));
        }
        return s.size();
    }

    int maxElements(){
        int mx = 0;
        map<int, int> m;
        for (int i = 0; i < N; ++i) {
            m[findSet(i)] ++;
        }
        set<pair<int, int>> s;
        for(auto p : m){
            s.insert({p.second, p.first});
        }
        return s.rbegin()->first ;
    }


};


template<typename T>
bool isPrime(T n)
{
    if (n <= 1)  return false;
    if (n <= 3)  return true;
    if (n%2 == 0 || n%3 == 0) return false;

    for (int i=5; i*i<=n; i=i+6)
        if (n%i == 0 || n%(i+2) == 0)
            return false;

    return true;
}


template <typename A, typename B>
map<B, A> map_transform(map<A, B> m){
    map<B, A> m1;
    for(auto p : m){
        m1[p->second] = p->first;
    }
    return m1;
};

struct jump{
    int height;
    string s;

};
ll sumOfDigitsFrom1ToN(ll n)
{
    // base case: if n<10 return sum of
    // first n natural numbers
    if (n<10)
        return n*(n+1)/2;

    // d = number of digits minus one in n. For 328, d is 2
    ll d = log10(n);

    // computing sum of digits from 1 to 10^d-1,
    // d=1 a[0]=0;
    // d=2 a[1]=sum of digit from 1 to 9 = 45
    // d=3 a[2]=sum of digit from 1 to 99 = a[1]*10 + 45*10^1 = 900
    // d=4 a[3]=sum of digit from 1 to 999 = a[2]*10 + 45*10^2 = 13500
    ll *a = new ll[d+1];
    a[0] = 0, a[1] = 45;
    for (int i=2; i<=d; i++)
        a[i] = a[i-1]*10 + 45*ceil(pow(10,i-1));

    // computing 10^d
    ll p = ceil(pow(10, d));

    // Most significant digit (msd) of n,
    // For 328, msd is 3 which can be obtained using 328/100
    ll msd = n/p;

    // EXPLANATION FOR FIRST and SECOND TERMS IN BELOW LINE OF CODE
    // First two terms compute sum of digits from 1 to 299
    // (sum of digits in range 1-99 stored in a[d]) +
    // (sum of digits in range 100-199, can be calculated as 1*100 + a[d]
    // (sum of digits in range 200-299, can be calculated as 2*100 + a[d]
    //  The above sum can be written as 3*a[d] + (1+2)*100

    // EXPLANATION FOR THIRD AND FOURTH TERMS IN BELOW LINE OF CODE
    // The last two terms compute sum of digits in number from 300 to 328
    // The third term adds 3*29 to sum as digit 3 occurs in all numbers
    //                from 300 to 328
    // The fourth term recursively calls for 28
    return msd*a[d] + (msd*(msd-1)/2)*p +
           msd*(1+n%p) + sumOfDigitsFrom1ToN(n%p);
}
void _() {
    int a,b;
    cin >> a >> b;
    cout << a*b - a - b+1;
}


int main() {
#ifdef Debug
    freopen("/home/joduskame/Desktop/cpp/IO/Input.txt", "r", stdin);
    freopen("/home/joduskame/Desktop/cpp/IO/Output.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    _();
    return 0;

}

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())
S = (A-1)*(B-1)
print(S)

Submission status: Runtime Error

Solution code:
a,b=map(int,intput().split())
print(a*b-a-b+1)

Submission status: Runtime Error

Solution code:
N=int(input())
num=0
for j in range(1,N+1,2):
  	cnt=0
    for i in range(1,j+1):
#        print(i)
#        print(j)
        if j%i==0 :
            cnt=cnt+1
    if cnt==8 :
#        print(cnt)
        num+=1
#    print("---")
print(num)

Submission status: Runtime Error

Solution code:
n,m,q  = map(int,input().split())
rails=[tuple(map(int,input().split())) for i in range(m)]
qs=[tuple(map(int,input().split())) for i in range(q)]
enuq = list(enumerate(qs))
 
enuq.sort(key = lambda x:x[1][0])
ansli = [0 for i in range(q)]


for (i,(p,q)) in enuq:
    removelist=[]
    for (j,(l,r)) in enumerate(rails):
        if p<=l and r<=q:
            ansli[i]=ansli[i]+1
        elif l<p:
            removelist.append(j)
    for jj in removelist:
        rails.pop(jj)



for a in ansli:
    print(a)

Submission status: Runtime Error

Solution code:
eval('print(('+input().replace(' ','-1)*(')+'-1))'

Submission status: Runtime Error

Solution code:
n,m,q = map(int, input().split())
lr = [tuple(map(int, input().split())) for _ in range(m)]
pq = [tuple(map(int, input().split())) for _ in range(q)]
 
x = [[] for _ in range(n)]
for l,r in lr:
    for i in range(l):
        x[i].append(r-1)
for p,q in pq:
    ans=0
    for j in x[p-1]:
        if j<q:
            ans+=1
    print(ans)
exit(0)

Submission status: Runtime Error

Solution code:
s = input()
k = int(input())
for c in range(len(s)):
    if s[c] == "1":
        k -= 1
        if k >= 0:
            print(1)
            break
    else:
        print(s[c])
        break

Submission status: Runtime Error

Solution code:
import os
A,B = map(int, os.system("dd").split())
print (A-1)*(B-1)

Submission status: Runtime Error

Solution code:
N = int(input())
if N >= 195:
  print("3")
elif N >= 165:
  print("2")
elif N >= 105:
  print("1")
else:
  print("0")

Submission status: Runtime Error

Solution code:
from bisect import bisect_left
 
n, m, q = map(int, input().split())
LR = [0]*m
for i in range(m):
    LR[i] = list(map(int, input().split()))
P = [0]*q
Q = [0]*q
for i in range(q):
    P[i], Q[i] = map(int, input().split())
 
LR.sort(key=lambda x: (x[0], x[1]))
L = list(map(lambda x: x[0], LR))
#print(LR)
 
C = [[0]*(n+1) for _ in range(n+1)]
for i in range(1,n+1):
    l = bisect_left(L, i)
    r = bisect_left(L, i+1)-1
    R2 = list(map(lambda x: x[1], LR[l:r+1]))
    #print(l, r, R2)
    for j in range(i,n+1):
        C[i][j] = bisect_left(R2, j+1)
    #print(i, C[i])
 
for i in range(q):
    ans = 0
    for j in range(P[i], Q[i]+1):
        ans += C[j][Q[i]]
    print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())
a=[105,135,165,195,189]
for i in renge(5):
 if n>=a[i]:
  s=i+1
print(s)

Submission status: Runtime Error

Solution code:
l = input().split()
num_city    = int(l[0])
num_train   = int(l[1])
num_qa      = int(l[2])


str_train = []
end_train = []
for i in range(num_train):
    l = input().split()
    dist = 0
    str_train.append( int(l[dist]) )
    dist = 1
    end_train.append( int(l[dist]) )

str_qa = []
end_qa = []

for i in range(num_qa):
    l = input().split()
    dist = 0
    str_qa.append( int(l[dist]) )
    dist = 1
    end_qa.append( int(l[dist]) )




S_str = []
s = {}
for i in range(num_city + 1):
    S_str.append(s)

for i in range(num_qa):
    str_v = str_qa[i]
    for j in range(0,str_v + 1):
        S_str[j].add(str_v)

S_end = []
s = {}
for i in range(num_city + 1):
    S_end.append(s)

for i in range(num_qa):
    end_v = end_qa[i]
    for j in range(end_v , num_city + 1):
        S_end[j].add(end_v)

for i in range(0,num_qa):
    str_v = str_qa[i]
    s1 = S_str[ str_v ]

    end_v = end_qa[i]
    s2 = S_end[ end_v ]

    s_intersection = s1 & s2

    print(len(s_intersection))

Submission status: Runtime Error

Solution code:
import math
a=input().split("¥n")
K=int(a[1])
S_len=len(a[0])

print("K="+str(K) +" S_len="+str(S_len))

for i in range(S_len):
    # print("i="+str(i) +" n="+a[0][i])
    n=int(a[0][i])
    # print("i="+str(i) +" n="+str(n))

    # if(n==1):
    #     K-=1
    #     if(K<=0):
    #         print("1")
    #         break
    # else:

    L=int(K*math.log10(n))
    # print("K="+str(K) +" L="+str(L))
    K-=L+1
    if(K<=0):
        print(n)
        break

Submission status: Runtime Error

Solution code:
N = int(input())
if N < 105:
  print(0)
elif 105 <= N < 155:
  print(1)
elif 155 <= N < 195:
  print(2)
else:
  print(3)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 18 21:48:15 2018

@author: nakag
"""
n = int(raw_input())
print(n)
#1からNまでで因数分解を行う
ans_lst = []

import math
for j in range(1,n+1):
    I=int(j)
    s=0
    R=int(I)
    L=[]
    while s==0:
        #R=int(math.sqrt(R))
        for i in range(2,R+1):
            if I%i==0:
                I=I/i
                if I==1:
                    s=1
                L.append(i)
                break
    print(len(L))

    #素数の数に応じて場合分け
    if len(L)==1:
        if L[0]**3 == j:
            ans_lst.append(1)
    
    elif len(L)==2:
        #約数が8のときとりえる場合の積を数える
        s1 = L[0] * L[1]**3
        s2 = L[0]**3 * L[1]
        if s1 == j:
            ans_lst.append(1)
        elif s2 ==j:
            ans_lst.append(1)
    elif len(L) ==3:
        s3 = L[0] * L[1] * L[2]
        if s3 == j:
            ans_lst.append(1)
    
    print(ans_lst)

Submission status: Runtime Error

Solution code:
S=input()
K=int(input())
for j in S:
	if j=='1':
		if j==K:
			co='1'
			break
	else:
		co=j
		break
print(co)

Submission status: Runtime Error

Solution code:
N = int(input())
if N < 105:
  print(0)
elif 105 <= N < 155:
  print(1)
else:
  print(2)

Submission status: Runtime Error

Solution code:
S=input()
K=int(input())
l=len(S)
r=0
q=0
if l==1:
    print(int(S))
else:
    for i in range(0,l-1):
        if int(S[i]) != 1:
            r=int(S[i])
            q=i
            break
    if q>K:
        print(1) 
    else:
        print(r)

Submission status: Runtime Error

Solution code:
N = int(input())
if N <= 105:
  print(1)
elif N > 105:
  print(2)

Submission status: Runtime Error

Solution code:
n,m,q = input().split()
list = []
for i in range(int(m)):
    l,r = input().split()
    list.append([int(l),int(r)])
for i in range(int(q)):
    p,q = input().split()
    count = 0
    for j in range(len(list)):
        if int(p) <= list[j][0] and int(q) >= list[j][1]:
            count += 1
    print(count)

Submission status: Runtime Error

Solution code:
import numpy as np
def main():
    N, M, Q = map(int, input().split())
    LR = []
    for i in range(M):
        l, r = map(int, input().split())
        LR.append([l-1, r])
    PQ = []
    for i in range(Q):
        p, q = map(int, input().split())
        PQ.append([p-1, q-1])
    ar = np.zeros([M, N])
    for m in range(M):
        ar[m, LR[m][0]:LR[m][1]] = 1
    flags_start = [np.ones(M, dtype=np.bool)]
    flags_end = []
    for i in range(1, N):
        flags_start.append((ar[:, :i].max(axis=1)==0))# * (ar[:, i:].max(axis=1)==1))
        flags_end.append((ar[:, i:].max(axis=1)==0))# * (ar[:, :i].max(axis=1)==1))
    flags_end.append(np.ones(M, dtype=np.bool))
    for q in range(Q):
        left = PQ[q][0]
        right = PQ[q][1]
        print(sum(flags_start[left] * flags_end[right]))

if __name__=='__main__':
    main()

Submission status: Runtime Error

Solution code:
import numpy as np

setting = list(map(int, input().split()))

train = []
quest = []
for i in range(setting[1]):
    num = list(map(int, input().split()))
    train.append(num)
train = np.array(train)

for i in range(setting[2]):
    q = list(map(int, input().split()))
    quest.append(q)

train = train * np.array([1,-1])
for qs in quest:
    a = train
    sch = np.array(qs)
    sch = sch * np.array([-1,1])
    b = a + sch
    ans = np.delete(b, np.where(b<0), axis=0)

    print(ans.shape[0])

Submission status: Runtime Error

Solution code:
 a, b = [int(x) for x in input().split()]
print(a * b - a - b + 1)

Submission status: Runtime Error

Solution code:
a = list(int(input().split()))
print((a[0]-1)*(a[1]-1))

Submission status: Runtime Error

Solution code:
import math

N=int(input())
cnt=0
num=0
for j in range(1,N+2,2):
    for i in range(1,j+1):
#        print(i)
#        print(j)
        if j%i==0 :
            cnt=cnt+1
    if cnt==8 :
#        print(cnt)
        num+=1
    cnt=0
#    print("---")
print(num)

Submission status: Runtime Error

Solution code:
n,m,q=map(int,input().split())
alist=[]
for i in range(m):
    l,r=map(int,input().split())
    alist.append([l,r])
alist.sort()
for t in range(q):
    count=0
    blist=[]
    p,q=map(int,input().split())
    for j in range (len(alist)):
        if p<=alist[0][0]:
            alist.sort(key=lambda x:x[1])
            break
        blist.append(alist[0])
        alist.remove(alist[0])
    for j in range (len(alist)):
        if q>=alist[j][1]:
            count+=1
        else:
            break
    for k in blist:
        alist.append(k)
    print(count)
    alist.sort(key=lambda x:x[0])

Submission status: Runtime Error

Solution code:
n,m,q=map(int,input().split())
counts=[[0 for _ in range(n)]for _ in range(n)]

for _ in range(m):
    l,r=map(int,input().split())
    for i in range(l):
        for j in range(r-1,n):
            counts[i][j]+=1
for _ in range(q):
    l,r=map(int,input().split())
    print(counts[l-1][r-1])

Submission status: Runtime Error

Solution code:
S = input()
K = input()
flag = 0
for i in range(len(S)):
    if S[i] =="1":
        continue
    elif S[i] =="2":
        print("2")
        flag = 1
    elif S[i] =="3":
        print("3")
        flag = 1
    elif S[i] =="4":
        print("4")
        flag = 1
    elif S[i] =="5":
        print("5")
        flag = 1
    elif S[i] =="6":
        print("6")
        flag = 1
    elif S[i] =="7":
        print("7")
        flag = 1
    elif S[i] =="8":
        print("8")
        flag = 1
    elif S[i] =="9":
        print("9")
        flag = 1

    break
if flag == 0:
    print("1")

Submission status: Runtime Error

Solution code:
import math
S = input()
K = int(input())

ps = []

for s in S:
    i = int(s)
    if(i == 1):
        p = -1
    else:
        p = 5*(10**15) * math.log(i)
    ps.append(p)

sum = 0
index = 0
    
if K == 1:
    print(S[0])
else:
    for p in ps:

        if not p == -1:
            sum += p
        else:
            K -= 1

        if math.log(K) < sum:
            #print(index)
            print(S[index])
            break
        index += 1

Submission status: Runtime Error

Solution code:
a = input()
m = int(a[0])
n = int(a[1])

print(m*n - m - n +1)

Submission status: Runtime Error

Solution code:
import bisect

N, M, Q = map(int, input().split())
trains = [list(map(int, input().split())) for i in range(M)]
queries = [list(map(int, input().split())) for i in range(Q)]
trains.sort(key = lambda x: x[1])
L = [train[0] for train in trains]
R = [train[1] for train in trains]

dp = [[0] * N for i in range(N)]
for i in range(N):
    for j in range(i, N):
        right = bisect.bisect_right(R, j + 1)
        A = sorted(L[:right])
        left = bisect.bisect_left(A, i + 1)
        dp[i][j] = right - left

for q in range(Q):
    pi, qi = queries[q]
    print(dp[pi - 1][qi - 1])

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import sys

a = int(sys.argv[1])
b = int(sys.argv[2])

garden = (a-1) * (b-1)
print(garden)

Submission status: Runtime Error

Solution code:
n = int(input())
if n < 105:
    print(0)
else:
    print(1)

Submission status: Runtime Error

Solution code:
import math

s = input()
k = math.log10(int(input()))
index_num = 0
pow_num = 5000000000000000
if k == 0:
  print(s[0])
  exit()
for i in s:
  new_index_num = index_num  + math.log10(int(i)) * pow_num
  if k > index_num and k <= new_index_num:
    print(i)
    break

Submission status: Runtime Error

Solution code:
s=input()
k=int(input())
if k==1:
    print(s[0])
else:
    if s[0]=="1":
        if k < =(10**18):
            print(s[1])
        else:
            print(s[2])
    else:
        if k < =(10**18):
            print(s[0])
        else:
            print(s[1])

Submission status: Runtime Error

Solution code:
N=int(input())
if(N<105):
  print(0)
elif(105<=N<135):
  print("1")
elif(135<=N<165):
  print("2")
elif(165<=N<189):
  print("3")
elif(189<=N<195):
  print("4")
else:
  print("5")

Submission status: Runtime Error

Solution code:
S = input()
K = int(input())
for i in S:
    if i != '1':
        print(i)
        break
    K -= 1
    if K == 0:
        print(1)
        break

Submission status: Runtime Error

Solution code:
n = int(input())
def cnt(x):
	return sum(1 for i in range(1, x+1) if x%i == 0)
print(sum(1 for i in range(1, n+1, 2) if cnt(i) == 8))

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
c=xprint((a-1)*(b-1))

Submission status: Runtime Error

Solution code:
N=int(input())
if(N<105):
  print(0)
elif(105<=N<135):
  print(1)
elif(135<=N<165):
  print(2)
elif(165<=N<189):
  print(3)
elif(189<=N<195):
  print(4)
else:
  print(5)

Submission status: Runtime Error

Solution code:
a, b = [int(x) for x in input().split()]

return a * b - a - b + 1

Submission status: Runtime Error

Solution code:
N=int(input())
if(N<105):
  print(0)
elif(105<=N<165):
  print(1)
elif(165<=N<195):
  print(2)
else:
  print(3)

Submission status: Runtime Error

Solution code:
A=int(input())
B=int(input())

ans=(A-1)*(B-1)

print(ans)

Submission status: Runtime Error

Solution code:
A=map(int,input())
B=map(int,input())

ans=(A-1)*(B-1)

print(ans)

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
ans=a*b-a-b+1
print(ans)

Submission status: Runtime Error

Solution code:
a=int(a)
b=int(b)

yrd=(a-1)*(b-1)

print yrd

Submission status: Runtime Error

Solution code:
s = input()
k = input()
t = '1'

for i in range(len(s)) :
   if s[i]=='1' :
      continue
   else :
      t = s[i]
      break

print(t)

Submission status: Runtime Error

Solution code:
import math

def make_prime_list_2(num):
    if num < 2:
        return []

    # 0のものは素数じゃないとする
    prime_list = [i for i in range(num + 1)]
    prime_list[1] = 0 # 1は素数ではない
    num_sqrt = math.sqrt(num)

    for prime in prime_list:
        if prime == 0:
            continue
        if prime > num_sqrt:
            break

        for non_prime in range(2 * prime, num, prime):
            prime_list[non_prime] = 0

    return [prime for prime in prime_list if prime != 0]

def prime_factorization_2(num):
    if num <= 1:
        return False
    else:
        num_sqrt = math.floor(math.sqrt(num))
        prime_list = make_prime_list_2(num_sqrt)

        dict_counter = {}
        for prime in prime_list:
            while num % prime == 0:
                if prime in dict_counter:
                    dict_counter[prime] += 1
                else:
                    dict_counter[prime] = 1
                num //= prime
        if num != 1:
            if num in dict_counter:
                dict_counter[num] += 1
            else:
                dict_counter[num] = 1

        return dict_counter

def search_divisor_num_2(num):
    if num < 0:
        return None
    elif num == 1:
        return 1
    else:
        divisor_num = 1
        dict_fact = prime_factorization_2(num)
        for value in dict_fact.values():
            divisor_num *= (value + 1)
        return divisor_num

eight_list = []
for i in range(100):
    ii = i * 2 + 1
    if search_divisor_num_2(ii) == 8:
        eight_list.append(ii)

n = int(input())
use_list = [1 for i in eight_list if i <= n]
print(sum(use_list))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import sys

a = sys.args[0]
b = sys.args[1]

garden = (a-1) * (b-1) + 1
print(garden)

Submission status: Runtime Error

Solution code:
N = int(input())
if N < 105:
    S = 0
elif N < 135:
    S = 1
elif N < 165:
    S = 2
elif N < 189:
    S = 3
elif N < 195:
    S= 4
else:
    S = 5
print(S)

Submission status: Runtime Error

Solution code:
n = int(input())
if n < 105:
  print(0)
else:
  ans = 0
  for i in range(n,103,-2):
    count = 1
    for j in range(1,99,2):
      nj = n%j
      if nj == 0:
        count += 1
      if count == 9:
        ans -= 1
    if count == 8:
      ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
inp = input()
n = int(inp)

if  n < 105:
  print(0)
elif 105 <= n <135:
  print(1)
elif 135 <= n <165:
  print(2)
elif 165 <= n <189:
  print(3)
elif 189 <= n <195:
  print(4)
elif 195 <= n:
  print(5)

Submission status: Runtime Error

Solution code:
N=int(input())
if N < 105:
    print(0)
elif 105 <= N and N < 135:
    print(1)
elif 135 <= N and N < 165:
    print(2)
elif 165 <= N and N < 189:
    print(3)
elif 189 <= N :
    print(4)

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())
print("{} {}".format((A - 1) * (B - 1)))

Submission status: Runtime Error

Solution code:
input_lines = raw_input().split()
a = int(input_lines[0])
b = int(input_lines[1])

print(a * b - (a + b - 1))

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3

def main():
    a = int(input().rstrip())
    b = int(input().rstrip())

    print((a-1)*(b-1))
    

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())
print((A-1) * (B-1))

Submission status: Runtime Error

Solution code:
s = input()
k = int(input())

for i in s:
    if i != '1':
        ans = int(i)
        break

print (i)

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())

ans = (a - 1) * (b - 1)
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())

if N <= 104 and N >= 1:
  print(0)
elif N >= 105:
  print(1)
elif N >= 135:
  print(2)
elif N >= 145:
  print(3)
elif N >= 165:
  print(4)
elif N >= 189:
  print(5)
elif N >= 195:
  print(6)

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())

print((A - 1) * (B - 1))

Submission status: Runtime Error

Solution code:
A, B = int(input()), int(input())
print((A-1) * (B-1))

Submission status: Runtime Error

Solution code:
a=raw_input().split();print((int(a[0])-1)*(int(a[1])-1));

Submission status: Runtime Error

Solution code:
a=input()
b=input()
if a>1 and b>1:
  C=(a-1)*(b-1)
else:
  break
print(C)

Submission status: Runtime Error

Solution code:
#106a
a,b=map(int,input().split())
pritn((a-1)*(b-1))

Submission status: Runtime Error

Solution code:
l = input().split()
a = l[0] * l[1]
b = l[0] + l[1] - 1
c = a - b
print(c)

Submission status: Runtime Error

Solution code:
a = raw_input().split();
print((int(a[0])-1)*(int(a[1])-1));

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())
print("{} {}".format((A - 1)(B - 1)))

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split(‘ ‘))
print((a - 1) * (b - 1))

Submission status: Runtime Error

Solution code:
A = input()
B = input()

a = A - 1
b = B - 1

farm_area = a * b


print(farm_area)

Submission status: Runtime Error

Solution code:
A, B = map(int, input().split())
print(format((A - 1)(B - 1)))

Submission status: Runtime Error

Solution code:
A=int(input())
B=int(input())
if A>1 and B>1:
  C=(A-1)*(B-1)
else:
  break
print(C)

Submission status: Runtime Error

Solution code:
A, B = map(int, input().split())
print("{} {}".format((A - 1)(B - 1)))

Submission status: Runtime Error

Solution code:
ab = raw_input().split()
print((int(ab[0])-1)*(int(ab[1])-1))

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())
ans = A*B - A - B + 1
print(ans)

Submission status: Runtime Error

Solution code:
x = int(input())
y = int(input())

N = (x - 1)*(y - 1)
print(N)

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split(“ “))
print((a - 1) * (b - 1))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
A=int(input())
B=int(input())
C=(A-1)*(B-1)
print("{}".format(C))

Submission status: Runtime Error

Solution code:
aa, b = map(int, input().split())
if a == 2 or b == 2:
    print(1)
else:
    print(a*b - (a + b - 1))

Submission status: Runtime Error

Solution code:
import sys

def square():
    argvs=sys.argv
    print( int(argvs[1])*int(argvs[2])-int(argvs[1])-int(argvs[2])+1)

square()

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
A=int(input())
B=int(input())
C=(A-1)*(B-1)
print(C)

Submission status: Runtime Error

Solution code:
def abc106_a():
    a, b = map(int, input().split())
    b = int(input())

    return a * b - a - b + 1


print(abc106_a())

Submission status: Runtime Error

Solution code:
a = list(map(int, input().split()))

print(a[0] * a[1] - (1 * a[0]) - (1 * a[1

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())

area = (a - 1) * (b - 1)
prin(area)

Submission status: Runtime Error

Solution code:
return (A-1)*(B-1);

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
s=(a-1)*(b-1)
print(s)

Submission status: Runtime Error

Solution code:
A, B=map(int, input().split()
S=(A-1)*(B-1)
print(S)

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())

# A, B = map(int, input().split())
print(A*B - A - B + 1)

Submission status: Runtime Error

Solution code:
A=int(input())
B=int(input())
C=(A-1)*(B-1)
print(C)

Submission status: Runtime Error

Solution code:
a = input()
b = input()
A = int(a)
B = int(b)
print((A*B)-A-B + 1)

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())
S = 4*(((A-1)/2) *((B-1)/2))
print(int(S))

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
ans = a * b - a - b + 1
print(ans)

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())

print(A * B - (A + B) + 1)

Submission status: Runtime Error

Solution code:
def SolveABC106A(A,B):
    print (int(A)-1) * (int(B)-1)

A = raw_input()
B = raw_input()
SolveABC106A(A,B)

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())

S = (A-1)*(B-1)
print(S)

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())

print((a-1) * (b-1))

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())
res = (A-1)*(B-1)

print(int(res))

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())

print((A-1) * (B-1))

Submission status: Runtime Error

Solution code:

A = int(input())
B = int(input())

print(A*B-A-B+1)

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())
Ans = (A-1)*(B-1)
print(Ans)

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())

print((A-1)*(B-1))

Submission status: Runtime Error

Solution code:
A = input()
B = input()
print((int(A)-1)*(int(B)-1))

Submission status: Runtime Error

Solution code:
def main():
    a = int(input())
    b = int(input())

    print((a-1) * (b-1))

        
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
print(a*b-a-b+1)

Submission status: Runtime Error

Solution code:
def menseki(a, b):
    return a * b - (1 * b + 1 * a - 1)

if __name__ == '__main__':
    la = int(input())
    lb = int(input())

    print(menseki(la, lb))

Submission status: Runtime Error

Solution code:
#coding: utf-8

a = int(raw_input())
b = int(raw_input())

print (a-1)*(b-1)

Submission status: Runtime Error

Solution code:
a, b = map(int,input().sprit())
print((a-1)*(b-1))

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())

print(a*b -(a+b-1))

Submission status: Runtime Error

Solution code:
S =int(input())
T=int(input())

print((S-1)*(T-1))

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())

print((a-1)*(b-1))

Submission status: Runtime Error

Solution code:
#encoding utf-8

a = int(input())
b = int(input())

area = (a-1)*(b-1)
print(area)

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())

print((a - 1) * (b - 1))

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
import sys

def main():
    a = int(sys.stdin.readline().rstrip())
    b = int(sys.stdin.readline().rstrip())

    print((a-1)*(b-1))
    

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())

print((A-1)*(B-1))

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
print((a-1)*(b-1))

Submission status: Runtime Error

Solution code:
A,B=map(int,input()split())
print(A*B-A-B+1)

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())
print(A*B-A-B+1)

Submission status: Runtime Error

Solution code:
a = int(input())-1
b = int(input())-1
print(a*b)

Submission status: Runtime Error

Solution code:
A=int(input())
B=int(input())
print(A*B-(A+B-1))

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
print(a * b - a - b + 1)

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())
print(A*B - A - B + 1)

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())
print((A - 1) * (B - 1))

Submission status: Runtime Error

Solution code:
def abc106_a():
    a = int(input())
    b = int(input())

    return a * b - a - b + 1


print(abc106_a())

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())

total = a * b - (a + b - 1)

print(total)

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())
print((A - 1) * (B - 1))

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())

print(A*B - A - B + 1)