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:

def main():
    n = int(input())

    
    
    def divide(n):
        counter = 0
        counter1 = 0
        if n % 2 != 0:
            for i in range(1, n+1, 2):
                for j in range(1, i+1):
                    if i % j == 0:
                        counter += 1
                if counter == 8:
                    counter1 += 1
                counter = 0
        else:
            for i in range(1, n, 2):
                for j in range(1, i+1):
                    if i % j == 0:
                        counter += 1
                if counter == 8:
                    counter1 += 1
                counter = 0
        return counter1

    print(divide(n))
                         
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:
n = int(input())
count_ans = 0
for i in range(n//2 + 1):
  count_y = 0
  for j in range(2*i+2):
    if j > 0:
      if (2 * i + 1)%j == 0:
        count_y += 1
  if count_y == 8:
    count_ans += 1
print(count_ans)

Submission status: Runtime Error

Solution code:
a,b = map(int, input().split())
a == 1
b == 1
for i in range(100):
	a = a + i
    for j in range(100):
		b = b + j
		c = (a-1) * (b-1)

Submission status: Runtime Error

Solution code:
a,b = map(int, input().split())
for 2 in range(100):
	c = (a-1) * (b-1)

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())
print(int((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:
#106 A

A=int(input())
B=int(input())
print(A*B - (A+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,b=map(int,input(,sprit()))
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=input().split.
A=int(a)
B=int(b)
print((A-1)*(B-1))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = input()
K = int(input())
L = [int(i) for i in S]
count = 1
for i in L:
    if i != 1:
        if count <= K:
            print(i)
        else:
            print(1)
        exit()
    else:
        count += 1
print(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 B = map(int,input().split(' '))
print((A-1) * (B-1))

Submission status: Runtime Error

Solution code:
s = raw_input()
k = int(raw_input())
count = 0
for n in s:
	count += ((int(n)**5)**10)**12
	if count>=k:
		print n
		break

Submission status: Runtime Error

Solution code:
s = raw_input()
k = int(raw_input())
for n in s:
	if k>=int(n)**(5*(10**14)):
		print n
		break
	else:
		k+=int(n)**(5*(10**14))

Submission status: Runtime Error

Solution code:
num = input().split(' ')
print((int(num[0]) - 1)＊(int(num[1]) - 1))

Submission status: Runtime Error

Solution code:
num = input().split(' ')
print((int(num[0]) - 1)＊(int(num[1]) - 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(int((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,B-map(int,input().split())
A=A-1
B=B-1
print(A*B)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
cond=input().split(" ")
n=int(cond[0])
m=int(cond[1])
q=int(cond[2])
train=[[0 for i in range(2)] for j in range(m)]
sect=[[0 for i in range(2)] for j in range(q)]

def judge(arr_m,arr_q):
    a=0
    if arr_q[0]<=arr_m[0] and arr_m[1]<=arr_q[1]:
        a=1
    return a

for i in range(m):
    train[i]=input().split(" ")
    train[i]=list(map(int,train[i]))
for i in range(q):
    sect[i]=input().split(" ")
    sect[i]=list(map(int,sect[i]))
for i in range(q):
    ans=0
    for j in range(m):
        ans+=judge(train[j],sect[i])
    print(ans)

Submission status: Runtime Error

Solution code:
cond=input().split(" ")
n=int(cond[0])
m=int(cond[1])
q=int(cond[2])
train=[[0 for i in range(2)] for j in range(m)]
sect=[[0 for i in range(2)] for j in range(q)]
#print(train)
 
def judge(arr_m,arr_q):
    a=0
    #print(arr_m)
    #print(arr_q)
    #print("*")
    if arr_q[0]<=arr_m[0] and arr_m[1]<=arr_q[1]:
        a=1
    return a
for i in range(m):
    train[i]=input().split(" ")
    train[i]=list(map(int,train[i]))
    #print(train)
for i in range(q):
    sect[i]=input().split(" ")
    sect[i]=list(map(int,sect[i]))
    #print(sect)
for i in range(q):
    ans=0
    for j in range(m):
        ans+=judge(train[j],sect[i])
    print(ans)

Submission status: Runtime Error

Solution code:
cond=input().split(" ")
n=int(cond[0])
m=int(cond[1])
q=int(cond[2])
train=[[0 for i in range(2)] for j in range(m)]
sect=[[0 for i in range(2)] for j in range(q)]
#print(train)

def judge(arr_m,arr_q):
    a=0
    #print(arr_m)
    #print(arr_q)
    #print("*")
    if arr_q[0]<=arr_m[0] and arr_m[1]<=arr_q[1]:
        a=1
    return a

for i in range(m):
    train[i]=input().split(" ")
    train[i]=list(map(int,train[i]))
    #print(train)
for i in range(q):
    sect[i]=input().split(" ")
    sect[i]=list(map(int,sect[i]))
    #print(sect)
for i in range(q):
    ans=0
    for j in range(m):
        ans+=judge(train[j],sect[i])
    print(ans)

Submission status: Runtime Error

Solution code:
cond=input().split(" ")
n=int(cond[0])
m=int(cond[1])
q=int(cond[2])
train=[[0 for i in range(2)] for j in range(m)]
sect=[[0 for i in range(2)] for j in range(q)]
#print(train)
 
def judge(arr_m,arr_q):
    a=0
    #print(arr_m)
    #print(arr_q)
    #print("*")
    if arr_q[0]<=arr_m[0] and arr_m[1]<=arr_q[1]:
        a=1
    return a
 
for i in range(m):
    train[i]=input().split(" ")
    train[i]=list(map(int,train[i]))
    #print(train)
for i in range(q):
    sect[i]=input().split(" ")
    sect[i]=list(map(int,sect[i]))
    #print(sect)
for i in range(q):
    ans=0
    for j in range(m):
        ans+=judge(train[j],sect[i])
    print(ans)

Submission status: Runtime Error

Solution code:
#Beginner Contest 106 C
cond=input().split(" ")
n=int(cond[0])
m=int(cond[1])
q=int(cond[2])
train=[[0 for i in range(2)] for j in range(m)]
sect=[[0 for i in range(2)] for j in range(q)]
#print(train)

def judge(arr_m,arr_q):
    a=0
    #print(arr_m)
    #print(arr_q)
    #print("*")
    if arr_q[0]<=arr_m[0] and arr_m[1]<=arr_q[1]:
        a=1
    return a

for i in range(m):
    train[i]=input().split(" ")
    train[i]=list(map(int,train[i]))
    #print(train)
for i in range(q):
    sect[i]=input().split(" ")
    sect[i]=list(map(int,sect[i]))
    #print(sect)
for i in range(q):
    ans=0
    for j in range(m):
        ans+=judge(train[j],sect[i])
    print(ans)

Submission status: Runtime Error

Solution code:
cond=input().split(" ")
n=int(cond[0])
m=int(cond[1])
q=int(cond[2])
train=[[0 for i in range(2)] for j in range(m)]
sect=[[0 for i in range(2)] for j in range(q)]


def judge(arr_m,arr_q):
    a=0
    
    if arr_q[0]<=arr_m[0] and arr_m[1]<=arr_q[1]:
        a=1
    return a

for i in range(m):
    train[i]=input().split(" ")
    train[i]=list(map(int,train[i]))
for i in range(q):
    sect[i]=input().split(" ")
    sect[i]=list(map(int,sect[i]))
for i in range(q):
    ans=0
    for j in range(m):
        ans+=judge(train[j],sect[i])
    print(ans)

Submission status: Runtime Error

Solution code:
cond=input().split(" ")
n=int(cond[0])
m=int(cond[1])
q=int(cond[2])
train=[[0 for i in range(2)] for j in range(m)]
sect=[[0 for i in range(2)] for j in range(q)]


def judge(arr_m,arr_q):
    a=0
    
    if int(arr_q[0])<=int(arr_m[0]) and int(arr_m[1])<=int(arr_q[1]):
        a=1
    return a

for i in range(m):
    train[i]=input().split(" ")
for i in range(q):
    sect[i]=input().split(" ")
for i in range(q):
    ans=0
    for j in range(m):
        ans+=judge(train[j],sect[i])
    print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())
total=0
for i in range(1,n+1,2):
  ans=0
  for j in range(1,i+1):
    if i%j==0:
      ans+=1
  if ans==8:
    total+=1
print(total)

Submission status: Runtime Error

Solution code:
def reflesh_string(current_answer):
    index = min(K, len(current_answer))
    return current_answer[:index]

def update_string(string_answer):
    string_answer = string_answer.replace("1", "1")
    string_answer = string_answer.replace("2", "22")
    string_answer = string_answer.replace("3", "333")
    string_answer = string_answer.replace("4", "4444")
    string_answer = string_answer.replace("5", "55555")
    string_answer = string_answer.replace("6", "666666")
    string_answer = string_answer.replace("7", "7777777")
    string_answer = string_answer.replace("8", "88888888")
    string_answer = string_answer.replace("9", "999999999")
    return string_answer
  
def check_skip(current_answer):
    counter = [0 for i in range(9)]
    for k in range(min(K, len(current_answer))):
        counter[int(current_answer[k])] = 1
    if(sum(counter) == 1):
        return True
    
    if(sum(counter) == 2 and current_answer[min(K, len(current_answer)) - 1] != "1"):
        return True
    
    return False
    
S = input().strip()
K = int(input().strip())
for c in range(5 * 10**15):
    S = update_string(S)
    S = reflesh_string(S)
    if(check_skip(S)):
        break
print(S[min(K, len(S)) - 1])

Submission status: Runtime Error

Solution code:
def reflesh_string(current_answer):
    index = min(K, len(current_answer))
    return current_answer[:index]

def update_string(string_answer):
    string_answer = string_answer.replace("1", "1")
    string_answer = string_answer.replace("2", "22")
    string_answer = string_answer.replace("3", "333")
    string_answer = string_answer.replace("4", "4444")
    string_answer = string_answer.replace("5", "55555")
    string_answer = string_answer.replace("6", "666666")
    string_answer = string_answer.replace("7", "7777777")
    string_answer = string_answer.replace("8", "88888888")
    string_answer = string_answer.replace("9", "999999999")
    return string_answer
  
def check_skip(current_answer):
    counter = [0 for i in range(9)]
    for k in range(min(K, len(current_answer))):
        counter[int(current_answer[k])] = 1
    if(sum(counter) == 1):
        return True
    
    if(sum(counter) == 2 and current_answer[K-1] != "1"):
        return True
    
    return False
    
S = input().strip()
K = int(input().strip())
for c in range(5 * 10**15):
    S = update_string(S)
    S = reflesh_string(S)
    if(check_skip(S)):
        break
print(S[K-1])

Submission status: Runtime Error

Solution code:
def reflesh_string(current_answer):
    index = min(K, len(current_answer))
    return current_answer[:index]

def update_string(string_answer):
    string_answer = string_answer.replace("1", "1")
    string_answer = string_answer.replace("2", "22")
    string_answer = string_answer.replace("3", "333")
    string_answer = string_answer.replace("4", "4444")
    string_answer = string_answer.replace("5", "55555")
    string_answer = string_answer.replace("6", "666666")
    string_answer = string_answer.replace("7", "7777777")
    string_answer = string_answer.replace("8", "88888888")
    string_answer = string_answer.replace("9", "999999999")
    return string_answer
  
def check_skip(current_answer):
    counter = [0 for i in range(9)]
    for i in range(1, 10):
        i = str(i)
        if(i in current_answer):
            counter[int(i) - 1] = 1
            
    if(sum(counter[1:]) > 1):
        return False
    
    if(counter[0] == 0)
            
    return True

def ch_skip(current_answer):
    for k in range(min(K, len(current_answer))):
        if(int(current_answer[k]) != 1):
            return False
    return True
    
S = input().strip()
K = int(input().strip())
for c in range(5 * 10**15):
    S = update_string(S)
    S = reflesh_string(S)
    if(check_skip(S)):
        break
print(S[K-1])

Submission status: Runtime Error

Solution code:
def reflesh_string(current_answer):
    index = min(K, len(current_answer))
    return current_answer[:index]

def update_string(string_answer):
    string_answer = string_answer.replace("1", "1")
    string_answer = string_answer.replace("2", "22")
    string_answer = string_answer.replace("3", "333")
    string_answer = string_answer.replace("4", "4444")
    string_answer = string_answer.replace("5", "55555")
    string_answer = string_answer.replace("6", "666666")
    string_answer = string_answer.replace("7", "7777777")
    string_answer = string_answer.replace("8", "88888888")
    string_answer = string_answer.replace("9", "999999999")
    return string_answer
  
def check_skip(current_answer):
    for k in range(K):
        if(int(current_answer[k]) != 1):
            return False
    return True
    
S = input().strip()
K = int(input().strip())
for c in range(5 * 10**15):
    S = update_string(S)
    S = reflesh_string(S)
    if(check_skip(S)):
        break
print(S[K-1])

Submission status: Runtime Error

Solution code:
S = input()
K = int(input())
counter = 0
for i in range(K + 1):
    if int(S[i]) != 1:
        log = counter
        num = int(S[i])
        break
    counter += 1

if K <= log:
    print(1)
else:
    print(num)

Submission status: Runtime Error

Solution code:
import math
N=int(input())
# def yakusuu(x):
#     tmplist=list(sy.factorint(x).values())
#     a=1
#     for i in tmplist:
#         a*=i+1
#     return a
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 search_divisor_num_1(num):
    if num < 0:
        return None
    elif num == 1:
        return 1
    else:
        num_sqrt = math.floor(math.sqrt(num))
        prime_list = make_prime_list_2(num_sqrt)

        divisor_num = 1
        for prime in prime_list:
            count = 1
            while num % prime == 0:
                num //= prime
                count += 1
            divisor_num *= count

        if num != 1:
            divisor_num *= 2

        return divisor_num
counter=0
for i in range(1,N+1,2):
    if search_divisor_num_1(i)==8:
        counter+=1
print(counter)

Submission status: Runtime Error

Solution code:
import math
N=int(input())
ans=0
count=0
for n in range(1,N+1,2):
	count=0
	for factor in range(1,n+1,2):
		if n%factor == 0:
			count+=1
	if count == 8:
		ans+=1
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())

count = 0
for i in range(1, n+1, 2):
    n_divisor = 1
    for j in range(2, n+1):
        if i%j == 0:
            n_divisor += 1
    if n_divisor == 8:
        count += 1

print(count)

Submission status: Runtime Error

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

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,b=map(int,input(),split())
print(a*b-a-b+1)

Submission status: Runtime Error

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

p = 0
for i in range(len(S)) :
	if (S[i] != "1") :
		print(S[i])
		p = 1
		break
	
if (p == 0) :
	print("1")

Submission status: Runtime Error

Solution code:
s=input();print(~-int(s[:2])*~-int(s[2:]))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

count_1=0
while s!='':
  if s[0]=='1':
    count_1+=1
    s=s.lstrip('1')
  else:
    break
if count_1>=k:
  print('1')
else:
  print(s[0])

Submission status: Runtime Error

Solution code:
print(eval('~-'+'*~-'.join(input().split()))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

Solution code:
# To Infinity
import re
s = input()
k = int(input())
ind = re.search(r'[23456789]', s)
if ind is None:
    ind = k
else:
    ind = ind.start()
if ind < k:
        print(s[ind])
else:
    print(1)

Submission status: Runtime Error

Solution code:
n=int(input())
if n<105:print(0)
elif n<3*5*9:print(1)
elif n<3*5*11:print(2)
else:print(3)

Submission status: Runtime Error

Solution code:
n=int(input())
l=0
for i in range(1,n+1):
  if i%2==1:    
    p=0
    for k in range(1,i+1):
      if i%k==0:
        p+=1
    if p==8:
      l+=1
print(l)

Submission status: Runtime Error

Solution code:
S = input()
K = int(input())
if K == 1 and S[0] == "1":
  print(1)
elif S[0] == "1":
  print(S[1])
else:
  print(S[0])

Submission status: Runtime Error

Solution code:
S = input()
K = int(input())
if K == 1 and S[0] == 1:
  print(1)
elif K != 1 and S[0] == 1:
  print(S[1])
else:
  print(S[0])

Submission status: Runtime Error

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

t = 0
u = s[0]

for i in range(len(s)):
	t +=1
	u = s[i]
	if s[i] !="1":                 #この時点でｔはi+1になっている
		break
if t<k+1:
	print(u)
else:
	print(1)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
lines = [i for i in range(24, n+1) if i % 2 != 0]

ans = 0
for i in lines:
    cnt = 0
    for j in range(1, i+1):
        if i % j == 0:
            cnt += 1
        if cnt == 8:
            ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())

ans = 0
for i in range(1, n+1):
    cnt = 0
    for j in range(1, i+1):
        if i % 2 != 0 and i % j == 0:
            cnt += 1
            if cnt == 8:
                ans += 1
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# coding: utf-8

s = input()
k = int(input())

not_one_index = 0
for i in range(len(s)):
    if s[i] == '1':
        not_one_index = not_one_index + 1
    else:
        break

if k <= not_one_index:
    print(1)
else:
    print(s[not_one_index])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split());pirnt(a*b-a-b+1)

Submission status: Runtime Error

Solution code:
N = int(input())
ans = 0

for i in range(1, N + 1):
    if i % 2 == 1:
        count = 0
        for j in range(1, i + 1, 2):
            if i % j == 0:
                count += 1
        if count == 8:
            ans += 1

print(ans)

Submission status: Runtime Error

Solution code:
s = input().split()
a, b = int(s[0]),int(s[1])
print(a-1)*(b-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:
A = int(input())
B = int(input())

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

print(ans)

Submission status: Runtime Error

Solution code:
N, M, Q = map(int, input().split())

a = [[0 for i in range(509)] for j in range(509)]
sum = [[0 for i in range(509)] for j in range(509)]

for i in range(M):
  p, q = map(int, input().split())
  a[p][q] += 1

for i in range(1,N+1):
  for j in range(i,N+1):
    sum[i][j] = sum[i][j-1] + a[i][j]


for i in range(Q):
  p, q = map(int, input().split())
  ans = 0
  for j in range(p,q+1):
    ans += sum[j][q] - sum[j][p-1]
  print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N=int(input())
count=0
answer=0

for i in range(N+1):
	count=0
	if i%2==1:
		for j in range(i):
			if i%(j+1)==0:
				count +=1
		
		if count==8:
			answer += 1
	
	print(answer)

print(answer)

Submission status: Runtime Error

Solution code:
n = int(input())
print(4 if n >= 189 else 3 if n >= 165 else if 2 if n >= 135 else 1 if n >= 105 else 0)

Submission status: Runtime Error

Solution code:
n = int(input())
print(4 if n >= 189 else 3 if n >= 165 else 2 if n >=n 135 else 1 if n >= 105 else 0)

Submission status: Runtime Error

Solution code:
x=raw_input()
y=input()
n=0
for i in range(len(x)):
    n+=int(x[i])**(5*(10**5))
    if n>=y:
        print x[i] 
        break

Submission status: Runtime Error

Solution code:
P = [105, 135, 165, 189, 195, 201]

N = int(input())

for i,p in enumerate(P):
  if N < p:
    print(i)
    break

Submission status: Runtime Error

Solution code:
import sys

N = float(input())
t = 3
prime_number = []
while t <= N / 15.0:
    l = []
    for i in range(t+1):
        if i != 0:
            if t % i == 0:
                l.append(i)
    if l == [1, t]:
        prime_number.append(t)
    t += 1
n = len(prime_number)
ans = 0
if n < 3:
    print(0)
    sys.exit()
else:
    for i in prime_number:
        for j in prime_number:
            if j != i:
                for k in prime_number:
                    if k != i and k != j:
                        if i * j * k <= N:
                            ans += 1
ans = ans / 6
if N >= 189:
    ans += 2
elif N >= 135:
    ans += 1
print(int(ans))

Submission status: Runtime Error

Solution code:
inputs = input()

yoko = int(inputs[0])
tate = int(inputs[1])

print((yoko - 1) * (tate - 1))

Submission status: Runtime Error

Solution code:
print((A-1)*(B-1))

Submission status: Runtime Error

Solution code:
i = input().split('')
a = int(i[0])
b = int(i[1])
print((a*b) - (a + b - 1) )

Submission status: Runtime Error

Solution code:
i=105
N=input()
N=int(N)
m=5
n=0
x=0
y=0
while i <= N:
  if i % 2 != 0:
    if i % 3 == 0:
      n = int(i / 3)
      while m < n:
        if i % m == 0:
          x = x + 1
        m=m+2
      if x == 4:
        y = y + 1
  x=0
  n=0
  m=5
  i = i + 1
print(y)

Submission status: Runtime Error

Solution code:
a=input()
b=int(input())
i=0
t=0
while t<0:
    if a[i]!='1':
        t=1
    else:
        i+=1
if i<(b-1):
    print(a[i])
else:
    print('1')

Submission status: Runtime Error

Solution code:
a=input()
b=int(input())
i=0
t=0
while t<0:
    if a[i]!='1':
        t=1
    else:
        i+=1
if i<b-1:
    print(a[i])
else:
    print('1')

Submission status: Runtime Error

Solution code:
a=input()
b=int(input())
i=0
t=0
while t<0:
    if a[i]!=1:
        t=1
    else:
        i+=1
if i<b:
    print(a[i])
else:
    print(1)

Submission status: Runtime Error

Solution code:
def main():
    S = [int(s) for s in list(input())]
    K = int(input())
    for i in S:
        if i != 1:
            print(i)
            break


if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
n = list(map(int, input().split()))
print(n[0]*n[1})

Submission status: Runtime Error

Solution code:
string = input()
a, b = string.split(' ')[0], string.split(' ')[1]
result = a * b - (a + b -1)
print(result)

Submission status: Runtime Error

Solution code:
input_A = input()
input_B = input()

A = int(input_A)
B = int(input_B)

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

Submission status: Runtime Error

Solution code:
input_H1 = input()
input_H2 = input()

H1 = int(input_H1)
H2 = int(input_H2)

print((H1-1)*(H2-1))

Submission status: Runtime Error

Solution code:
a, b = (int(i) for i in input().split()) 
print((c-1)*(d-1))

Submission status: Runtime Error

Solution code:
a, b = (int(i) for i in input().split()) 
print(c*d)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy

l = raw_input().split()

c =((l[0] - 1) * (l[1] - 1))

print(c)

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline
N, M, Q = map( int, input().split())
NN = [ [ 0 for _ in range(N+1)] for _ in range(N+1)]
for _ in range(M):
    L, R = map( int, input().split())
    NN[L][R] += 1
Sum = [ [ 0 ] for _ in range(N+1)]
for i in range(1,N+1):
    for j in range(1,N+1):
        Sum[i].append(Sum[i][-1]+NN[i][j])
for _ in range(Q):
    p, q = map(int, input().split())
    ans = 0
    for i in range(p,q+1):
        ans += Sum[i][q] - Sum[i][p-1]
    print(ans)

Submission status: Runtime Error

Solution code:
l=raw_input().split()
 
print((l[0]-1)-(l[1]-1))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
l=raw_input().split()
 
print((l[0]-1)-(l[1]-1)+1)

Submission status: Runtime Error

Solution code:
import sys
n = int(input())

#条件満たす数カウント
cn = 0
#約数カウント
cy = 0

if n < 105:
    print(0)
    sys.exit()

for i in range(105, n+1):
    if i % 2 == 0:
        continue

    for j in range(1, i+1):
        if i % j == 0:
            cy += 1
    if cy == 8:
        cn += 1
    cy = 0
print(cn)

Submission status: Runtime Error

Solution code:
#abc106c
import sys

s=raw_input()
k=int(raw_input())
if s.count('1')==len(s):
 print '1'
 sys.exit()
for i in xrange(k):
 if s[i]!='!':
  print s[i]
  sys.exit()

Submission status: Runtime Error

Solution code:
count = 0

s_chars = input()
k_num = int(input())

for i in s_chars:
    if i == '1':
        count += 1
    else:
        break

if s_chars[0] != '1':
    print(s_chars[0])
else:
    if count >= k_num:
        print(s_chars[k_num - 1])
    else:
        print(s_chars[count])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
list = []
for i in range(1, N):
  numbers = []
  for a in range(1, i):
    if i % a == 0:
      numbers.append()
  if len(numbers) == 8:
      list.append(i)
print(len(list))

Submission status: Runtime Error

Solution code:
l = int(input().split())
print(l(0) * l(1) - (l(0) + l(1) -1))

Submission status: Runtime Error

Solution code:
l = map(int, raw_input().split())
print(l(0) * l(1) - (l(0) + l(1) - 1))

Submission status: Runtime Error

Solution code:
l = map(int, raw_input().split())
print(l(0) * l(1) - (l(0) + l(1) -1))

Submission status: Runtime Error

Solution code:
l = input().split()
print(l(0) * l(1) - (l(0) + l(1) -1))

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
def main():
    A, B = input().split()
    print((A - 1) * (B - 1))

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
N = int(input())
count = 0
answer = 0
for x in range(1,N+1,2):
    for i in range(1,x+1):
        if x % i == 0:
            count += 1
    if count == 8:
        answer +=1
    count = 0
print (answer)

Submission status: Runtime Error

Solution code:
data = input()
a = int(data[0])
b = int(data[1])
print(a * b - a - b + 1)

Submission status: Runtime Error

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