peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
N, M = map(int, input().split())

AC = 0
pena = 0

lst = [0] * N
for _ in range(M):
    a, b = map(str, input().split())
    a = int(a) - 1
    if lst[a] < 0:
        continue
    else:
        if b == 'WA':
            lst[a] += 1
        else:
            AC += 1
            pena += lst[a]
            lst[a] = -1

print (AC, pena)
# Judge status: Accepted
#!/usr/bin/env python3
import collections as cl
import sys


def II():
    return int(sys.stdin.readline())


def MI():
    return map(int, sys.stdin.readline().split())


def LI():
    return list(map(int, sys.stdin.readline().split()))


def main():
    N, K = MI()
    original = input()
    num_happy = 0

    for i in range(N - 1):
        if original[i] == original[i+1]:
            num_happy += 1

    print(min(N-1, num_happy + 2 * K))


main()
# Judge status: Wrong Answer
n=int(input())
a,b,c=[0]*n,[0]*n,[0]*n
for i in range(n):
  a[i],b[i],c[i]=map(int,input().split())
dp=[[0]*3 for _ in range(n)]
dp[0]=[a[0],b[0],c[0]]
for i in range(n-1):
  dp[i+1][0]=max(dp[i+1][0],dp[i][1]+a[i+1],dp[i+1][2]+a[i+1])
  dp[i+1][1]=max(dp[i+1][1],dp[i][0]+b[i+1],dp[i+1][2]+b[i+1])
  dp[i+1][2]=max(dp[i+1][2],dp[i][1]+c[i+1],dp[i+1][0]+c[i+1])
print(max(dp[n-1]))
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=0
t=a[0]
for x in range(n):
    c+=min(t+a[x+1],b[x])
    t=a[x+1] if a[x]>=b[x] else max(0,a[x+1]-b[x]+t)
print(c)
# Judge status: Accepted
x = input().split()
N, D= [int(i) for i in x]
t = 0
while N > 0:
  N -= (2*D+1)
  t += 1
print(t)
# Judge status: Wrong Answer
a, b = map(int, input().split())

if a+b>24:
  print(a+b-24)
else:
  print(a+b)
# Judge status: Wrong Answer
A = int(input())
B = int(input())
C = [1,2,3]
C.remove(A)
C.remove(B)
print(C)
# Judge status: Accepted
n = int(input())
mod = int(1e9)+7
print((pow(10, n, mod) - 2*pow(9, n, mod) + pow(8, n, mod))%mod)
# Judge status: Accepted
N, R = map(int, input().split())

if N >= 10:
    print(R)
else:
    print(R + 100 * (10 - N))
# Judge status: Wrong Answer
N, M = [int(i) for i in input().split()]

cnt = 0
while N > 0 and M > 0:
    cnt += 1
    N -= 1
    M -= 2

while M >= 4:
    cnt += 1
    M -= 4

print(cnt)
# Judge status: Wrong Answer
s = input()
n = int(s)
l = len(s)
isall9 = True
for i in range(1, l):
    if s[i] != "9":
        isall9 = False
if isall9:
    print(1 + 9 * (l - 1) )
else:
    res = int(int(s[0]) - 1) + 9 * (l - 1)
    print( res)
# Judge status: Accepted
import itertools
def main():
    n,k = tuple([int(t)for t in input().split()])

    a = tuple([int(t)for t in input().split()])

    for _ in range(min(41,k)):
        b = [0]*(n+1)
        for i in range(n):
            l = max(0,i-a[i])
            r = min(n,i+a[i]+1)
            b[l] += 1
            b[r] -= 1
        a = list(itertools.accumulate(b))[:n]

    print(*a)



if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
D, N = map(int, input().split())
list = []
i = 1

while len(list) < N:
  if D != 0:
    list.append(i * 100 ** D)
    i += 1
    
  else:
    if i != 100:
      list.append(i)
      i += 1
    else:
      i += 1
    
print(list[-1])
# Judge status: Accepted
N, R= [int(item) for item in input().split()]

if N >= 10:
    ans = R
else:
    ans = 100 * (10 - N) + R

print(ans)
# Judge status: Accepted
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

n, m = na()
h = set()
mi = 0
for i in range(m):
    if n-i-mi-(i+1) in h:
        mi += 1
    if (n-i-mi) -(i+1) == (i+1+n) - (n-i-mi):
        mi += 1
    print(i+1, n-i-mi)
    h.add(n+i+1 - (n-i-mi))
# Judge status: Wrong Answer
K,A,B = map(int,input().split())
ans = K + 1

t = ((K+1) // (A+1)) * B
t += (K+1) % (A+1)
ans = max(ans,t)
print(ans)
# Judge status: Accepted
#-*- coding: utf-8 -*-
import math

r = int(input())
print(r*2*math.pi)
# Judge status: Accepted
s = input()
x, y = int(s[:2]), int(s[2:])

if (1 <= x <= 12) & (1 <= y <= 12):
    print('AMBIGUOUS')
elif 1 <= x <= 12:
    print('MMYY')
elif 1 <= y <= 12:
    print('YYMM')
else:
    print('NA')
# Judge status: Wrong Answer
A,B = [int(i) for i in input().split()]

C = A + B

if C > 24:
    print(C - 24)
else:
    print(C)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
a = list(set(a))
a.sort()
l = len(a)
min = float("INF")
for i in range(l - 1):
    x = a[i + 1] - a[i]
    if min > x:
        min = x
ans = float("INF")
for i in range(l):
    a[i] = a[i] % min
    if a[i] == 0:
        a[i] += min
    if ans > a[i]:
        ans = a[i]
print(int(ans))
# Judge status: Wrong Answer
N = int(input())

alphabets = [chr(i) for i in range(97, 97+26)] 

E = []
E.append( N%26 )

while N/26 > 1 :
  N = int(N/26)
  E.append( N%26 )

w = []
for ee in E:
  w.append(alphabets[ee-1])

print("".join(list(reversed(w))))
# Judge status: Accepted
n=int(input())
l = list(map(int,input().split()))
s=1
if 0 in l:
    print(0)
else:
    for i in l:
        s*=i
        if s>10**18:
            s=-1
            break
    print(s)
# Judge status: Accepted
from collections import deque

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

node=[[]for _ in range(n)]

for i in range(m):
  x,y=map(int,input().split())
  node[x-1].append(y-1)
  node[y-1].append(x-1)

d=deque()
seen=[-1]*n
d.append(0)

while d:
  vi=d.popleft()
  for i in node[vi]:
    if seen[i]==-1:
      d.append(i)
      seen[i]=vi

if "-1" in seen:
  print("No")
else:
  print("Yes")
  for i in range(1,len(seen)):
    print(seen[i]+1)
# Judge status: Accepted
n = int(input())
s = input()

w = [0]*(n+1)
e = [0]*(n+1)

# e,wの累積和を記録
for i, d in enumerate(s):
    if d == "W":
        w[i+1] = w[i] + 1
        e[i+1] = e[i]
    else:
        e[i+1] = e[i] + 1
        w[i+1] = w[i]

mnum = n
for i, d in enumerate(s):
    mnum = min(mnum, w[i] + e[n] - e[i+1])

print(mnum)
# Judge status: Wrong Answer
import itertools
n=int(input())
l=list(map(int,input().split()))

ans=0
for pair in itertools.combinations(l,3):
    pair=list(pair)
    pair.sort()
    print(pair)
    if pair[0]+pair[1]>pair[2]>abs(pair[0]-pair[1]) and pair[0]!=pair[1]!=pair[2]:
        ans+=1
print(ans)
# Judge status: Accepted
a,b = map(int,input().split())
if (a + b) %2 == 0:
    print((a+b)//2)
else:
    print("IMPOSSIBLE")
# Judge status: Accepted
a,b,c=map(int, input().split())
print(min(c,b//a))
# Judge status: Accepted
from decimal import Decimal
L = Decimal(input())

print((L/3)**3)
# Judge status: Accepted
s = input().split()
print(s[1] + s[0])
# Judge status: Accepted
from collections import Counter

N=int(input())
s=[0]*N
t=[0]*N
d=dict()
cnt=0

for i in range(N):
  s[i]=input()
  t[i]=str(sorted(s[i]))
  if t[i] not in d:
    d[t[i]] =1
    #print(i,d)
  else:
    cnt += d[t[i]]
    d[t[i]] +=1
    #print(i,d)

print(cnt)
# Judge status: Wrong Answer
from heapq import heapify, heappush, heappop
N = int(input())
Alist = list(map(int, input().split()))
heapify(Alist)
while len(Alist)>2:
    Alist = [a for a in Alist if a > 0]
    min_num = heappop(Alist)
    for i in range(len(Alist)):
        Alist[i] %= min_num
    heappush(Alist, min_num)
print(Alist[0])
# Judge status: Wrong Answer
n=int(input())
mod=10**9+7
l=list(map(int,input().split()))
d=len(str(bin(max(l))))-2
ll=[[0,0] for i in range(d)]
ans=0
for i in l:
  f=bin(i)[2:]
  for v in range(len(f)):
    ll[v][int(f[-1-v])]+=1
for i,(a,s) in enumerate(ll):
  ans+=pow(2,i,mod)*a*s%mod
  ans%=mod
print(ans)
# Judge status: Wrong Answer
a, b, c, x, y = map(int, input().split())
if a + b <= 2 * c:
    ans = a * x + b * y
else:
    z = min(x, y)
    ans = 2 * c * min(x, y) + a * (x - z) + b * (y - z)
print(ans)
# Judge status: Accepted
import sys
X = int(input())
for i in range(-1000,1000):
    for j in range(-1000,1000):
        if i**5 - j**5 == X:
            print(i,j)
            sys.exit()
# Judge status: Wrong Answer
a,b = map(int,input().split())
if a==1:
  print('Alice')
elif b==1:
  print('Bob')
elif a>b:
  print('Alice')
elif b>a:
  print('Bob')
else:
  print('Draw')
# Judge status: Accepted
def main():
    K, X = map(int,input().split())
    if K*500>=X:
        print("Yes")
    else:
        print("No")

if __name__=='__main__':
    main()
# Judge status: Accepted
a,b,c=map(int,input().split())
if a%2 and b%2 and c%2:
  ans=min([a*b,a*c,b*c])
else:
  ans=0
print(ans)
# Judge status: Wrong Answer
#!/usr/bin/env python3
def main():
    def expected_val(limit):
        return (1 + limit) / 2

    N, K = map(int, input().split())
    P = [int(x) for x in input().split()]

    lst = []
    res = 0
    for p in P:
        res += expected_val(p)
        lst.append(res)
    if N - K == 0:
        print(lst[0])
        return
    ans = 0
    for i in range(N - K):
        res = lst[i + K] - lst[i]
        ans = res if res > ans else ans
    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Accepted
n = int(input())
p = list(map(int, input().split()))
count = 0
for i in range(n):
    if p[i] == i+1:
        if p[i] == n:
            p[i], p[i-1] = p[i-1], p[i]
        else:
            p[i], p[i+1] = p[i+1], p[i]
        count += 1
print(count)
# Judge status: Accepted
N=int(input())
Z=[list(map(int,input().split())) for i in range(N)]
A,B=zip(*Z)
A=list(A[::-1])
B=list(B[::-1])
ans=0
for i in range(N):
  A[i]+=ans
  if A[i]%B[i]!=0:
    a=B[i]-(A[i]%B[i])
    ans+=a
print(ans)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
x = 0

for i in range(n):
    if a[i] != n:
        x += b[a[i] - 1]
        if i != n -1:
            if a[i + 1] == a[i] + 1:
                x += c[a[i] - 1]
        
    else:
        x += b[a[i] - 1]


print(x)
# Judge status: Accepted
from collections import defaultdict
from collections import deque
import itertools
import math

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()

n,m = readInts()

if n*2<m:
	ans = n
	m-=n*2
	ans+=m//4
else:
	ans = m//2

print(ans)
# Judge status: Accepted
S = input()
if S[0] == S[1] == S[2] == 'R':
    print(3)
elif S[0] == S[1] == 'R' or S[2] == S[1] == 'R':
    print(2)
elif S[0] == S[1] == S[2] == 'S':
    print(0)
else:
    print(1)
# Judge status: Wrong Answer
import math

N = int(input())
X = list(map(int, input().split()))
sum = 0
all = True
max = 0
for a in X:
    sum = sum + a
    if max <= a:
        max = a
    for c in X:
        if(a != c):
            all = False
ans = 0
for b in X:
    ans = ans + (b-math.ceil(max))**2
if all == True:
    ans = 0
    print(ans)
else:
    print(ans)
# Judge status: Accepted
import math
n = int(input())
r = ":("
for i in range(50000):
    if math.floor(i*1.08) == n:
        print(i)
        exit()
    if math.floor(i*1.08) > n:
        break
print(r)
# Judge status: Wrong Answer
A,B = map(int,input().split())

AA = A*100//8
BB = B*10
AAA = [i for i in range(AA,(A+1)*100//8+1)]
BBB = [i for i in range(BB,(B+1)*10+1)]
AB_list = list(set(AAA)&set(BBB))

ans = min(AB_list) if AB_list and (12<min(AB_list)<=1000) else -1
print(ans)
# Judge status: Accepted
N,M=map(int,input().split())
A=[input() for i in range(N)]
B=''.join([input() for i in range(M)])
f=0
for i in range(N-M+1):
    for j in range(N-M+1):
        if ''.join([A[l][j:j+M] for l in range(i,i+M)])==B:
            f=1
print(['No','Yes'][f])
# Judge status: Accepted
## coding: UTF-8
N = int(input())

ans = [0] * (10**4+10)
for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            #print(x, y, z)
            p = x*x + y*y + z*z + x*y + y*z + z*x
            if(p < 10**4+10):
                ans[p] += 1

#print(ans[:30])
for i in range(N):
    print(ans[i+1])
# Judge status: Accepted
a=int(input())
a_keta=len(str(a))
if a_keta==1:print(a)
if a_keta==2:print(9)
if a_keta==3:print(9+a-100+1)
if a_keta==4:print(909)
if a_keta==5:print(909+a-10000+1)
if a_keta==6:print(90909)
# Judge status: Accepted
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
def f(x):
    return t-x*0.006
for i in range(n):
    h[i]=abs(f(h[i])-a)
m=min(h)
for i in range(n):
    if h[i]==m:
        print(i+1)
# Judge status: Wrong Answer
num = [input() for i in range(3)]
result = (int(num[0])+int(num[1]))*int(num[2])/2
print(result)
# Judge status: Wrong Answer
c = sorted(list(input().split()))
 
if c[0]=='A' and c[2]=='B':
  print('Yes')
else:
  print('No')
# Judge status: Accepted
N, D = map(int, input().split())
# a,b=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
# c=list(map(int, input().split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき
# s=[list(map(int,list(input()))) for i in range(h)]  # 二次元配列入力　二次元マップみたいな入力の

count = 0

for i in range(N):
    X, Y = map(int, input().split())
    if D**2 >= X**2+Y**2:
        count += 1

print(count)
# Judge status: Accepted
N = int(input())
ans = ""

while N:
    ans = str(N % 2)+ans
    N = -(N//2)

print(ans if ans != ""else 0)
# Judge status: Accepted
import math
a,b,h,m = map(int, input().split())

do = 360*((h+m/60)/12 - m/60)
do = min(do, 360-do)
print((a**2 + b**2 - 2*a*b*math.cos(math.radians(do)))**(0.5))
# Judge status: Wrong Answer
import math

n=int(input())
seq=list(map(int,input().split()))
print(sum(seq)-1)
# Judge status: Accepted
K, X = map(int, input().split())
if 500*K >= X:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
a,b = map(int,input().split())
count =0
for i in range(a,b+1):
  if str(i) == str(i)[::-1]:
    count += 1
print(count)
# Judge status: Accepted
n = int(input())
aa = list(map(int,input().split()))


for a in aa:
  if a % 2 == 0:
    if a % 3 == 0 or a % 5 == 0:
      pass
    else:
      print('DENIED')
      break
else:
  print('APPROVED')
# Judge status: Accepted
n=int(input())
s=str(input())

ans=0
for i in range(1,n):
  be_s=set(s[:i])
  af_s=set(s[i:])
  num=len(be_s & af_s)
  ans=max(ans,num)
  
print(ans)
# Judge status: Accepted
import sys
import math
import numpy as np
import copy

def main():
    s = input()
    print("ARC" if s == "ABC" else "ABC")
    return 0

if __name__ == '__main__':
    sys.exit(main())
# Judge status: Accepted
N = int(input())
a = list(map(int, input().split()))
if not 1 in a:
    print(-1)
else:
    num = 0
    for i in range(N):
        if a[i] == num+1:
            num += 1
    print(N-num)
# Judge status: Wrong Answer
n = int(input())
lst = [int(i) for i in input().split()]

list.sort(lst)
print(lst)
lst2 = []
total = 0
for i in range(n):
  num = lst[i]
  if len(lst2) == 2:
    total += lst2[1]
    lst2.pop(1)
    lst2.append(num)
  if len(lst2) == 1:
    total += lst2[0]
    lst2.append(num)
  if not lst2:
    lst2.append(num)
  #print(total)
print(total)
# Judge status: Accepted
n, k = map(int, input().split())
p = sorted(list(map(int, input().split())))
ans = 0
for i in range(k):
    ans += p[i]
print(ans)
# Judge status: Wrong Answer
n,d = map(int,input().split())

print(-(-(n-d)//(d+1)))
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
import math
sunuke = 0
kuma = sum(a)

memo = abs(2*a[0] - sum(a))
ans = abs(2*a[0] - sum(a))

for i in range(n):
    sunuke += a[i]
    kuma -= a[i]
    if abs(sunuke-kuma) > memo:
        ans = memo
    else:
        memo = abs(sunuke-kuma)

print(ans)
# Judge status: Accepted
n,m=map(int,input().split())
py=[list(map(int,input().split()))+[i] for i in range(m)]

py.sort(key=lambda x:x[0]*10**6+x[1])
ne=[1]*(10**5+1)
ans=[]

for p,_,i in py:
    ans.append((str(p).zfill(6)+str(ne[p]).zfill(6),i))
    ne[p]+=1

ans.sort(key=lambda x:x[1])
for s,_ in ans:
    print(s)
# Judge status: Accepted
s = list(input())
n = len(s)

p, t = '', ''

cnt = 0

for char in s:
	t += char
	if p == t:
		continue
	cnt += 1
	p, t = t, ''

print(cnt)
# Judge status: Accepted
N = int(input())
B = list(map(int,input().split()))
A = N*[0]

for n in range(N-1):
  if n==0:
    A[n]=B[n]
  else:
    A[n] = min(B[n-1],B[n])

print(sum(A)+B[-1])
# Judge status: Accepted
import math


def lcm(a, b):
    return (a * b) // math.gcd(a, b)


def main():
    n = int(input())
    ts = [int(input()) for _ in range(n)]
    ans = 1
    for t in ts:
        ans = lcm(ans, t)
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Accepted
a, b, c = map(int, input().split())
if c - a - b < 0:
    print("No")
    exit()
if 4 * a * b < (c - a - b) ** 2:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
a,b,c=map(int,input().split())

d=max(a,b,c)*3
e=a+b+c

if d%2 == e%2:
    print((d-e)//2)
else:
    print((d+3-e)//2)
# Judge status: Accepted
N, C, K = map(int, input().split())
T = [int(input()) for _ in range(N)]
T.sort()

first = T[0]
count = 0
res = 0
for i in range(N):
    if count < C and T[i] <= first + K:
        count += 1
    else:
        res += 1
        first = T[i]
        count = 1
print(res + 1)
# Judge status: Wrong Answer
s=input()
r=''
for i in s:
    r+=i
    if(r*2==s):
        print("Yes")
        break
else:
    print("No")
# Judge status: Accepted
a,b = map(str, input().split())
print(b+a)
# Judge status: Wrong Answer
A,B,M = [int(x) for x in input().split()]
A_list = [int(x) for x in input().split()]
B_list = [int(y) for y in input().split()]
discount = []
min = 100000
for _ in range(M):
  case = [int(x) for x in input().split()]
  discount.append(case)

min_a = sorted(A_list)[0]
min_b = sorted(B_list)[0]

for i in range(M):
  temp = A_list[discount[i][0]-1] + B_list[discount[i][1]-1] - discount[i][2]
  if temp < min:
    min = temp
    
if min_a + min_b > min:
  print(min)
else:
  print(min_a + min_b)
# Judge status: Accepted
N,C,K=map(int,input().split())
T=[int(input()) for _ in range(N)]
T.sort()

ans=0
wait=[]
for i in range(N):
    t=T[i]
    if len(wait)>0 and t-wait[0]>K:
        ans+=1
        wait=[]
    wait.append(t)
    if len(wait)==C:
        ans+=1
        wait=[]
if len(wait)>0:
    ans+=1
print(ans)
# Judge status: Accepted
N = int(input())

a = 2
b = 1
if N == 0:
    print(a)
elif N == 1:
    print(b)
else:
    for i in range(N-1):
        c = a + b
        a = b
        b = c
    print(c)
# Judge status: Wrong Answer
import sys
import math
import itertools
from collections import deque

s=input()
Q=deque([])
for c in s:
    Q.append(c)
q=int(input())
rev=1
for _ in range(q):
    opt=list(input().split())
    if(opt[0]=="1"):
        rev^=1
    else:
        f=int(opt[1])
        if(rev==1):
            f=3-f
        if(f==1):
            Q.appendleft(opt[2])
        else:
            Q.append(opt[2])
if(rev==1):
    Q.reverse()
for ch in Q:
    print(ch,end="")
# Judge status: Accepted
n = int(input())

arr=[]

for i in range(n):
    x,l = map(int,input().split())
    arr.append([x,l,x-l,x+l])
arr.sort(key=lambda x: x[3])

#print(arr)

ans = 0
start=-100000
fin=-1000

start = arr[0][2]
fin=arr[0][3]

for a,b,c,d in arr[1:]:
    if c < fin:
        ans+=1
        pass
    elif c >= fin:
        start=c
        fin = d

print(n-ans)
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
x=a+b
if x>a+c:
	x=a+c
elif x>b+c:
	x=b+c
print (x)
# Judge status: Wrong Answer
import sys
import math

N,M=map(int,input().split())

divisor_set=set()
for i in range(1,int(math.sqrt(M+1))):
  if M%i==0:
    divisor_set.add(i)
    divisor_set.add(M//i)
#print(divisor_set)

divisor_list=list(divisor_set)
divisor_list.sort()

for l in divisor_list:
  if l>=N:
    answer=M//l
    print(answer)
    break
# Judge status: Wrong Answer
x=int(input())
data=[x//105,x//104,x//103,x//102,x//101,x//100]
ans=0
for i in range(data[0]):
  for j in range(data[1]):
    for k in range(data[2]):
      for l in range(data[3]):
        for m in range(data[4]):
            if (x-(105*i+104*j+103*k+102*l+101*m))%100==0:
              print(1)
              exit()
print(0)
# Judge status: Accepted
A,B,K=map(int,input().split())
if B-A+1<=2*K:
  for i in range(A,B+1):
    print(i)
else:
  for i in range(A,A+K):
    print(i)
  for i in range(B-K+1,B+1):
    print(i)
# Judge status: Wrong Answer
N = int(input())
if N >= 10:
  for i in range(2,9):
    if N % i == 0 and N/i <= 9:
      print('Yes')
      exit(0)
  print('No')
else:
  for i in range(1,9):
    if N % i == 0 and N/i <= 9:
      print('Yes')
      exit(0)
  print('No')
# Judge status: Accepted
A,B,C,X,Y = map(int,input().split())

ans = 10**9+7

for i in range(max(X,Y)+1):
    AB = i*2
    money = max(0,A*(X-i))+max(0,B*(Y-i))+C*AB
    ans = min(ans,money)
    
print(ans)
# Judge status: Accepted
import math, bisect
N, M = map(int, input().split())

def f(x):
  l = []
  for i in range(1, int(math.sqrt(x)+1)):
    if x % i == 0:
      l.append(i)
      l.append(x//i)
  l.sort()
  return l

fac = f(M)
print(fac[bisect.bisect_right(fac, M//N)-1])
# Judge status: Accepted
A, B, C, X = [int(input()) for _ in range(4)]

count = 0

for a in range(A + 1):
    for b in range(B + 1):
        for c in range(C + 1):
            com = 500*a + 100*b + 50*c
            if X == com:
                count += 1

print(count)
# Judge status: Accepted
n = int(input())
ac = 0
wa = 0
tle = 0
re = 0

for i in range(n) :
    s = input().rstrip('\n')
    if s == 'AC' :
        ac += 1
    elif s == 'WA' :
        wa += 1
    elif s == 'TLE' :
        tle += 1
    elif s == 'RE' :
        re += 1

print('AC x',ac)
print('WA x',wa)
print('TLE x',tle)
print('RE x',re)
# Judge status: Wrong Answer
S = input()
for i in range(1 << 3):
    op = ['+'] * 3
    for j in range(3):
        if i >> j:
            op[j] = '-'
    res = ''.join([s + p for s, p in zip(S, op)])
    res += S[-1]
    if eval(res) == 7:
        res += '=7'
        print(res)
        break
# Judge status: Accepted
N = list(input())
#print(N)
if N[len(N)-1]=="2" or N[len(N)-1]=="4" or N[len(N)-1]=="5" or N[len(N)-1]=="7" or N[len(N)-1]=="9":
	print("hon")
elif N[len(N)-1]=="3":
  	print("bon")
else:
	print("pon")
# Judge status: Accepted
n = int(input())
s = input()
if n % 2 == 1:
    print('No')
else:
    if s[:n//2] == s[n//2:]:
        print('Yes')
    else:
        print('No')
# Judge status: Accepted
import math

N = int(input())
CSF = [()]
for _ in range(N-1):
    CSF.append(tuple(map(int, input().split())))
#print(CSF)

for start in range(1, N):
    time = CSF[start][0] + CSF[start][1]
    for transit in range(start+1, N):
        temp = math.ceil(time / CSF[transit][2]) * CSF[transit][2]
        time = max(temp, CSF[transit][1]) + CSF[transit][0]
    print(time)
print(0)
# Judge status: Wrong Answer
#Coding:Utf-8
N=int(input())
print('{:.10f}'.format(2/N))
# Judge status: Accepted
a, b, c = map(int, input().split())

if a == b == c or (a != b and b != c and a != c):
    print('No')
else:
    print('Yes')
# Judge status: Accepted
import sys

x, a, b = map(int, sys.stdin.readline().split())

def main():
    db = abs(b - x)
    da = abs(a - x)
    ans = 'A' if da < db else 'B'
    print(ans)

if __name__ ==  '__main__':
    main()
# Judge status: Wrong Answer
s = input()
c = 0

for i in range(len(s)):
  if s[1] == '1':
    c += 1
print(c)
# Judge status: Accepted
H,W = map(int,input().split())
x = H//2
ans = (H*W+1)//2
if H == 1:
    ans = 1
if W == 1:
    ans = 1
print(ans)
# Judge status: Accepted
A,B,K=map(int,input().split())
ans=[]
for i in range(1,min(A,B)+1):
    if A%i==0 and B%i==0:
        ans.append(i)
print(ans[-K])
# Judge status: Accepted
def pow_k(x, n):
    """
    O(log n)
    """
    if n == 0:
        return 1

    K = 1
    while n > 1:
        if n % 2 != 0:
            K *= x
        x *= x
        n //= 2

    return K * x

N=int(input())
L=list(map(int,input().split()))
import sys
ans = sys.maxsize

for i in range(-100,101):
  m_diffs = 0
  for j in range(N):
    m_diffs += pow_k((L[j] - i),2)
  ans = min(ans, m_diffs)

print(ans)
# Judge status: Accepted

X = int(input())
if(X>=30):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
def INT():
    return int(input())

def MI():
    return map(int, input().split())

def LI():
    return list(map(int, input().split()))

from collections import  Counter
N = INT()
S = [input() for _ in range(N)]

S = Counter(S)
print(f"AC x {S['AC']}")
print(f"WA x {S['WA']}")
print(f"TLE x {S['TLE']}")
print(f"RE x {S['RE']}")