peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
N, C, K = map(int, input().split())
arr = sorted([int(input()) for _ in range(N)])
start_t = arr[0]
bus_n = 0
ans = 1
for i in range(N):
    if arr[i] <= start_t + K and bus_n < C:
        bus_n += 1
    else:
        bus_n = 1
        start_t = arr[i]
        ans += 1
print(ans)
# Judge status: Accepted
n, r = input().split()
n = int(n)
r = int(r)

if n > 10:
    print(r)
    
else:
    print((10 - n)* 100 + r)
# Judge status: Wrong Answer
x = [x for x in input().split()]
print('Yes') if x[0]*500>x[1] else print('No')
# Judge status: Accepted
import math
n,k = map(int,input().split())
print(math.ceil((n-k) / (k-1)) + 1)
# Judge status: Accepted
n = int(input())
s = input()
c = s.count(".")
ans = c
for i in range(n):
    if s[i] =="#":
        c +=1
    else:
        c -=1
    ans = min(ans,c)
print(ans)
# Judge status: Accepted
# -*- coding: utf-8 -*-
import sys

X,N = list(map(int, input().rstrip().split()))
p_list = list(map(int, input().rstrip().split()))
#-----

p_set = set(p_list)
delta = 0

while True:
    for d in [-delta, delta]:
        n = X + d
        
        if n in p_set:
            continue
        else:
            print(n)
            sys.exit()
    
    delta += 1
# Judge status: Wrong Answer

import math
import itertools
import statistics
#import numpy as np
#import collections
a, b, k = list(map(int, input().split()))
l = []

if k > b-a:
    k = b-a

for i in range(k):
    l.append(a+i)
    l.append(b-i)


ans = list(set(l))
ans.sort()
for i in range(len(ans)):
    print(ans[i])
# Judge status: Accepted
a, b, c = map(int, input().split())
k = int(input())
ma = max(a,b,c)

if ma == a:
  print(a*(2**k)+b+c)
elif ma == b:
  print(b*(2**k)+a+c)
elif ma == c:
  print(c*(2**k)+a+b)
# Judge status: Accepted
N = input()
if (N[0] == N[1]) and (N[1]==N[2]) and (N[2]==N[0]):
    print(N)
elif int(N[0]) == int(N[1]) and int(N[1]) > int(N[2]):
    print(N[0]*3)
elif int(N[0]) > int(N[1]):
    print(N[0]*3)
else:
    print(str(int(N[0])+1)*3)
# Judge status: Accepted
from collections import deque
D=deque(input().rstrip())
Q=int(input())
count=0
for _ in range(Q):
	Y=list(input().split())
	if Y[0]=="1":
		count=(count+1)%2
	else:
		if Y[1]=="1":
			if count==0:
				D.appendleft(Y[2])
			else:
				D.append(Y[2])
		else:
			if count==0:
				D.append(Y[2])
			else:
				D.appendleft(Y[2])
D=list(D)
if count==0:
	print("".join(D))
else:
	D.reverse()
	print("".join(D))
# Judge status: Accepted
a=list(map(int,input().split()))
if a[0]<0:
    a[0]=-a[0]
x=a[0]%a[2]
y=a[0]//a[2]
if y>=a[1]:
    print(a[0]-a[1]*a[2])
elif (a[1]-y)%2==1:
    print(a[2]-x)
else:
    print(x)
# Judge status: Accepted
N = int(input())
if N > 999:
    print("ABD")
else:
    print("ABC")
# Judge status: Accepted
a,b,c = map(int, input().split())
print("YES" if b-a==c-b else "NO")
# Judge status: Accepted
def main():
    a, b, k = map(int,input().split())
    cnt = 0
    for i in range(max(a,b), 0, -1):
        if a % i == 0 and b % i == 0:
            #print(i)
            cnt += 1
            if cnt == k:
                print(i)
                return

if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
n = int(input())
s = input()
e_cnt = 0
for i in range(n):
    if s[i] == "E":
        e_cnt += 1
ans = e_cnt
w_cnt = 0
for i in range(n):
    ans = min(w_cnt + e_cnt - 1, ans)
    if s[i] == "W":
        w_cnt += 1
    else:
        e_cnt -= 1

print(ans)
# Judge status: Accepted
n=int(input())

A=[0]+list(map(int,input().split()))

for i in reversed(range(1,n+1)):
    if sum(A[::i])%2!=A[i]:
        A[i]^=1
        
print(sum(A))
if sum(A)!=0:
    for i,a in enumerate(A):
        if a==1:
            print(i)
# Judge status: Accepted
from itertools import accumulate, permutations, combinations, product, combinations_with_replacement, groupby
from math import floor, ceil, sqrt, factorial, log
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict
from heapq import heappop, heappush, heappushpop
from itertools import product
import sys
stdin = sys.stdin
mod = 10**9 + 7


def ns(): return stdin.readline().rstrip()


def ni(): return int(ns())


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


x = ni()
ans = 1
for b in range(2, 100):
    for p in range(2, 10):
        if b**p <= x:
            ans = max(ans, b**p)
print(ans)
# Judge status: Accepted
s,w=map(int,input().split())
if s<=w:
    print('unsafe')
else:
    print('safe')
# Judge status: Wrong Answer
import math
N, K = map(int,input().split())
A = [int(i) for i in input().split()]

low = 1
high = 10 ** 9
if K == 0:
    print(max(A))
else:
    while high - low > 1:
        mid = (low + high) / 2
        times = 0
        for a in A:
            times += math.ceil(a / mid) - 1
        if K >= times:
            high = mid
        else:
            low = mid
        #print(mid)

    print(math.ceil(mid))
# Judge status: Wrong Answer
s=input()
if (int(s[0])*int(s[-1]))%2 == 1:
  print("Odd")
else:
  print("Even")
# Judge status: Wrong Answer
S = list(input())

cnt = 1
L = [0]*len(S)
flag = False

for i in range(len(S)-1):
    if flag == True:
        L[i] ,L[i+1] = 1, 1
        flag = False
    elif S[i] != S[i+1]:
        if i+2 == len(S):
            L[i+1] = 1
        L[i] = 1
        cnt += 1
    elif S[i] == S[i+1]:
        flag = True


print(sum(L))
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
 
count = 0
while True:
  A, mod = zip(*[divmod(a, 2) for a in A])
  if sum(mod) > 0:
    break
  count += 1
print(count)
# Judge status: Accepted
import itertools
import math

 
N = int(input())
ls2 = []
for i in range(N):
    ls1 = list(map(int,input().split()))
    ls2.append(ls1)

lis = [x for x in range(N)]
permutations_lis = itertools.permutations(lis)

dis = 0
for one_case in permutations_lis:
    for i in range(1,N):
        dis += ((ls2[one_case[i]][0]-ls2[one_case[i-1]][0])**2+(ls2[one_case[i]][1]-ls2[one_case[i-1]][1])**2)**(1/2)
    
print(dis/(math.factorial(N)))
# Judge status: Wrong Answer
n,b,r= map(int,input().split())
if b==0 and r==0:
  print(n)
elif b==0:
  print(0)
else:
  print(n-r)
# Judge status: Accepted
n = int(input())

x = n//100
m = n%100

if 5*x<m:
    print(0)
else:
    print(1)
# Judge status: Accepted
# import fractions
# import sys
from sys import stdin

n, m = map(int, stdin.readline().rstrip().split())
ans = 0

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

print(ans)
# Judge status: Accepted
H, N = map(int, input().split())
waza = list(map(int, input().split()))

if H <= sum(waza):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
S = input()
m = int(S[5:7])
print('Heisei') if m <= 4 else print('TBD')
# Judge status: Wrong Answer
s = input()

ans = 753
for i in range(len(s)-3):
  subs = int(s[i:i+3])
  ans = min(abs(753-subs),ans)
  
print(ans)
# Judge status: Wrong Answer
N,L=map(int,input().split())
M=[0]*N
for i in range(N):
  M[i]=sorted(list(str(input())))
M.sort()
ans=''
for i in range(N):
  for j in range(L):
    ans+=M[i][j]
print(ans)
# Judge status: Accepted
ABC=list(map(int,input().split(' ')))
print(max([sum(ABC) + ABC[i]*9 for i in range(3)]))
# Judge status: Accepted
a=int(input())
b=int(input())
if a==1 and b==2 or a==2 and b==1:
    print(3)
elif a==1 and b==3 or a==3 and b==1:
    print(2)
else:
    print(1)
# Judge status: Wrong Answer
a = input()
s = 'pink'

if a >= '3200':
    print('s')

else:
    print('red')
# Judge status: Accepted
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

n=ni()
s=[_ for _ in input()]


mx=0

for i in range(n):
  sr =s[:i]
  sl = s[i:]
  r=set(sr)
  l=set(sl)

  nn=len(r & l)
  mx = max(nn,mx)

print(mx)
# Judge status: Accepted
n=int(input())
print((10**n-2*9**n+8**n)%int(1e9+7))
# Judge status: Accepted
A, B, C, K = map(int, input().split())
num_A = min(A, K)
num_B = min(B, K - num_A)
num_C = K - num_A - num_B
ans = num_A - num_C
print(ans)
# Judge status: Accepted
a,b,c,d = input()
if a==b or b==c or c==d:
    print('Bad')
else:
    print('Good')
# Judge status: Accepted
S=input()
ans=1000
for i in range(len(S)-2):
  s=int(S[i:i+3])
  ans=min(ans,abs(753-s))
print(ans)
# Judge status: Wrong Answer
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n = int(readline())
a = list(map(int, readline().split()))
b = list(map(int, readline().split()))
cnt = 0
for i in range(n):
    if a[i] > b[i]:
        cnt += a[i] - b[i]
    else:
        cnt += (b[i] - a[i]) // 2
if sum(b) - sum(a) >= cnt:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
C = [list(map(int, input().split())) for _ in range(3)]
x = C[1][0]-C[0][0] == C[1][1]-C[0][1] == C[1][2]-C[0][2]
y = C[2][0]-C[0][0] == C[2][1]-C[0][1] == C[2][2]-C[0][2]
if x and y:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
#!/usr/bin/env python3

def main():
    n, k = map(int, input().split())
    arr = sorted([list(map(int, input().split())) for i in range(n)])
    for ab in arr:
        k -= ab[1]
        if k <= 0:
            ans = ab[0]
            break

    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
a,b,t=map(int,input().split())
print((t+0.5)//a*b)
# Judge status: Wrong Answer
N = int(input())
v = [int(i) for i in input().split()]
ans=v[0]
for i in range(1,N):
    ans = (ans+v[i])/2
print(ans)
# Judge status: Wrong Answer
n = int(input())
s = input()
ans = 0
for i in range(1,len(s)-1):
  ans = max(ans, len(set(s[:i]) & set(s[i+1:])))
print(ans)
# Judge status: Accepted
L, R, d = map(int, input().split())

count = 0
for i in range(L, R + 1):
    if i % d == 0:
        count += 1


print(count)
# Judge status: Accepted
n=int(input())
s=set()
for i in range(n):
  x=input()
  if x in s:
    s.discard(x)
  else:
    s.add(x)
print(len(s))
# Judge status: Accepted
import sys

stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

n = ni()
l = nl()
print(min(sum((x-y)**2 for x in l) for y in range(101)))
# Judge status: Wrong Answer
K = int(input())
A, B = list(map(int, input().split()))

# A =< K =< Bの場合
if K >= A and K <= B:
    print('OK')
elif K < (B - A):
    print('OK')
elif (K * 2) >= A and (K * 2) <= B:
    print('OK')
elif K == 1:
    print('OK')
else:
    print('NG')
# Judge status: Accepted
N = int(input())
A = int(input())

a = N % 500
if a <= A:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
N, K = input().split(" ")
A = [int(i) for i in input().split(" ")]
N = int(N)
K = int(K)

res = N - K
last = A[K-3] * A[K-2] * A[K-1]

for i in range(1, res+1):
  mul = A[K+i-3] * A[K+i-2] * A[K+i-1]
  if mul > last:
    print("Yes")
  else:
    print("No")
  last = mul
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-

S = input().strip()
#-----

num_red = S.count("0")
num_blue = len(S) - num_red

print( min(num_red,num_blue) * 2 )
# Judge status: Accepted
s=set(input())
a=set([chr(ord('a') + i) for i in range(26)])
b=sorted(s ^ a)
if len(b)!=0:
	print(b[0])
else:
	print('None')
# Judge status: Accepted
n,k = map(int,input().split())
h = [0]*n

for i in range(n):
  h[i] = int(input())
ans = []
h.sort()
for i in range(0,n-k+1):
  ans.append(h[i+k-1]-h[i])
  #print(i,i+k)
print(min(ans))
# Judge status: Accepted
import sys
input = sys.stdin.readline
mod = 10**9 + 7

n = int(input())
s = input().rstrip()

from collections import Counter

c = Counter(s)

n_ = len(c.keys())

ans = 1

for i in c.keys():
    ans *= (c[i] + 1)
    ans %= mod

ans -= 1

print(ans)
# Judge status: Accepted
s = input()
print('2018/01/'+s[-2:])
# Judge status: Accepted
import math

N, H = map(int, input().split())
a_l = []
b_l = []
for _ in range(N):
    a, b = map(int, input().split())
    a_l.append(a)
    b_l.append(b)

a_l.sort(reverse=True)
b_l.sort(reverse=True)
ans = 0
for i in range(N):
    if a_l[0] >= b_l[i]:
        break
    else:
        ans += 1
        H = max(H - b_l[i], 0)
        if H <= 0:
            break
ans += math.ceil(H / a_l[0])
print(ans)
# Judge status: Wrong Answer
n = int(input())
a = []
b = []
for i in range(n):
    x, y = map(int, input().split())
    a.append(x)
    b.append(y)
a = a[::-1]
b = b[::-1]

ans = 0
for i in range(n):
    if b[i]==1:
        continue
    else:
        t = abs((a[i]+ans) % b[i])
        ans += b[i]-t

print(ans)
# Judge status: Wrong Answer
c = input()
if 97 <= ord(c) <= 111:
    print('vowel')
else:
    print('consonant')
# Judge status: Wrong Answer
N, K = map(int, input().split())

i = 1
while True:
    if N > K ** i:
        i += 1
    else:
        i -= 1
        break
print(i + 1)
# Judge status: Wrong Answer
n, m = map(int, input().split())

if n >= 3 and m >= 3:
    print((n-2)*(m-2))
elif (n >= 3 and m == 2) or (n == 2 and m >= 3) or (n == 2 and m == 2):
    print(0)
elif (n == 1 and m >= 3) or (n >= 3 and n == 1):
    print(max(n, m)-2)
elif (n == 1 and m == 2) or (n == 2 and m == 1):
    print(0)
elif n == 1 and m == 1:
    print(1)
# Judge status: Accepted
K,S = map(int,input().split())

ans = 0
for X in range(K+1):
    for Y in range(K+1):
        Z = S - (X+Y)
        if 0 <= Z <= K:
            ans += 1

print(ans)
# Judge status: Accepted
def main(k,n,a):
    lst = []
    lst.append(a[0]+(k-a[-1]))
    for i in range(n-1):
        lst.append(a[i+1]-a[i])
    return k-max(lst)
    
k,n = map(int,input().split())
a = list(map(int,input().split()))
print(main(k,n,a))
# Judge status: Wrong Answer
MOD = 10**9 + 7
n, a, b = map(int, input().split())

def comb(n, k):
    x, y = 1, 1
    for i in range(n, n-k, -1):
        x = x * i % MOD
    for i in range(2, k+1):
        y = y * pow(i, MOD-2, MOD) % MOD
    return x*y % MOD

ans = pow(2, n, MOD)-1
ans -= comb(n,a) + comb(n,b)
if ans < 0:
    ans += MOD

print(ans)
# Judge status: Wrong Answer
num_all = int(input())
list = input().split(" ")
list_int = []
for i in list:
  list_int.append(int(i)) 
print(list_int)

for j in range(num_all):
  a = list_int.count(j)
  print(a)
# Judge status: Accepted
A,B,C= map(int, input().split())
K = int(input())

for i in range(0,K):
    if C <= B or C <= A:
        C = C * 2
        continue

    if B <= A:
        B = B * 2
        continue

if C > B and B > A:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
from sys import stdin


def main():
    input = lambda: stdin.readline()[:-1]
    S = input()

    flag = 0
    n = len(S)
    if S == S[::-1]:
        flag += 1
    s = S[:n//2]
    if s == s[::-1]:
        flag += 1
    s = S[(n+3)//2-1:]
    if s == s[::-1]:
        flag += 1
    if flag == 3:
        print('Yes')
    else:
        print('No')


main()
# Judge status: Accepted
N = int(input())
T = [list(map(int, input().split())) for i in range(N)]
dp = [[0 for i in range(3)] for j in range(N+1)]
dp[1] = T[0]
for i in range(2,N+1):
    dp[i][0] = max(dp[i-1][1]+T[i-1][0],dp[i-1][2]+T[i-1][0])
    dp[i][1] = max(dp[i-1][0]+T[i-1][1],dp[i-1][2]+T[i-1][1])
    dp[i][2] = max(dp[i-1][0]+T[i-1][2],dp[i-1][1]+T[i-1][2])
print(max(dp[-1]))
# Judge status: Accepted
n=int(input())
s=input()
lst=[0]*n
lst[0]=s[1:].count("E")
for i in range(1,n):
    lst[i] = lst[i-1]
    if s[i-1]=="W":
        lst[i]+=1
    if s[i]=="E":
        lst[i]-=1
print(min(lst))
# Judge status: Accepted
N = int(input())
ans = [0]

for i in range(1, N+1):
    dp = []
    k = 1
    while i >= k:
        dp.append(ans[i-k]+1)
        k *= 6
    k = 1
    while i >= k:
        dp.append(ans[i-k]+1)
        k *= 9
    ans.append(min(dp))
print(ans[-1])
# Judge status: Accepted
import math
n,k = map(int,input().split())
a_list = list(map(int,input().split()))
print(math.ceil((n-1)/(k-1)))
# Judge status: Accepted
import sys
from bisect import bisect_left

sys.setrecursionlimit(10 ** 6)
INF = float("inf")
MOD = 10 ** 9 + 7


def input():
    return sys.stdin.readline().strip()


def main():
    N = int(input())
    L = list(map(int, input().split()))
    L.sort()
    ans = 0
    for i in range(N):
        a = L[i]
        for j in range(i + 1, N):
            b = L[j]
            ans += max(bisect_left(L, a + b) - (j + 1), 0)

    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Accepted
N=int(input())
S=input()

ans = 0
for i in range(N):
	s1,s2=set(S[:i]),set(S[i:])
	tmp = len(s1.intersection(s2))
	if tmp > ans:ans=tmp


print(ans)
# Judge status: Accepted
n = input()

count = 1
for i in range(len(n)-1):
  if n[i] == n[i+1]:
    count += 1
    if count >= 3:
      break
  else:
    count = 1

if count >= 3:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
n = int(input())
b = list(map(int,input().split()))

a = [0 for _ in range(n)]

for i in range(n-1):
    if i == 0:
        a[i] = b[i]
        a[i+1] = b[i]
    if b[i] < b[i-1] and i > 0:
        a[i] = b[i]
        a[i+1] = b[i]
    elif b[i] >= b[i-1] and i > 0:
        a[i+1] = b[i]

print(sum(a))
# Judge status: Accepted
from math import sqrt

x = int(input())

for i in range(-int(sqrt(sqrt(x))), int(sqrt(sqrt(x))) + 1):
    for j in range(-int(sqrt(sqrt(x))), int(sqrt(sqrt(x))) + 1):
        if i ** 5 - j ** 5 == x:
            print(i, j)
            exit()
# Judge status: Accepted
p,q,r=map(int,input().split())
print(p+q+r-max(p,q,r))
# Judge status: Accepted
import math
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

if sum(a) > sum(b):
  print ('No')
  exit()
elif sum(a) == sum(b):
  for i in range(n):
    if a[i] != b[i]:
      print ('No')
      exit()
  print ('Yes')
  exit()

s = sum(b)-sum(a)
c = 0
for i in range(n):
  if a[i] < b[i]:
    c += math.ceil((b[i]-a[i])/2)
if c > s:
  print ('No')
else:
  print ('Yes')
# Judge status: Accepted
import math
A, B = map(int, input().split())

#  B <= 1 + (A - 1) * n
#  n >= (B - 1) / (A - 1)

print(math.ceil((B - 1) / (A - 1)))
# Judge status: Accepted
N,X = map(int,input().split())
L = list(map(int,input().split()))
count = 1
posi = 0
for i in L:
    posi +=i
    if(posi<=X):
        count+=1
    else:
        break
print(count)
# Judge status: Accepted
n = int(input())
s = input()
if n >= 2 and n % 2 == 0:
    half = s[:n//2]
else:
    print('No')
    exit()

if half * 2 == s:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
N,M = map(int,input().split())

ar = [0]*(N+1)

for _ in range(M):
  a,b = map(int,input().split())
  if ar[a] != 0:
    ar[a] = min(ar[a],b)
  else:
    ar[a] = b
  if ar[b] != 0:
    ar[b] = min(ar[b],a)
  else:
    ar[b] = a

print("Yes")
for i in range(1,N):
  print(ar[i+1])
# Judge status: Accepted
dic = {}
N = int(input())
pre = input()
dic[pre] = 0
flag = True
for i in range(N-1):
    s = input()
    if list(pre)[len(pre)-1]!=list(s)[0]:
        flag=False

    if s in dic:
        flag=False
    else:
        dic[s]=0

    pre = s

print("Yes" if flag else "No")
# Judge status: Wrong Answer
j = ''.join
s = sorted
i = input
l = [j(s(i())), j(s(i(), reverse=True))]
print(["No", "Yes"][l == s(l)])
# Judge status: Accepted
from bisect import bisect_right, bisect_left
import numpy as np

n = int(input())

top = map(int, input().split())
mid = map(int, input().split())
bot = map(int, input().split())
top = np.array(sorted(top))
mid = np.array(sorted(mid))
bot = np.array(sorted(bot))

ans = 0
for i in mid:
    top_num = len(top[:bisect_left(top,i)])
    bot_num = len(bot[bisect_right(bot,i):])
    ans += top_num * bot_num

print(ans)
# Judge status: Accepted
S = input()
n = len(S)-1

while n > 1:
    n = len(S)
    S = S[:n-1]
    if len(S)%2 != 0:
        continue
    m = len(S)//2
    x = S[:m]
    y = S[m:]
    if x == y:
        n =len(S)
        break

print(n)
# Judge status: Wrong Answer
s = input()
K = int(input())

ans = ''
for i, c in enumerate(s):
    dif = ord('z') - ord(c) + 1
    if i == len(s) - 1:
        K %= 26
        if ord(c) + K > ord('z'):
            K -= 26
        ans += chr(ord(c) + K)
    elif dif <= K:
        ans += 'a'
        K -= dif
    else:
        ans += c
print(ans)
# Judge status: Wrong Answer
a,b,c = map(int, input().split())

if a+b>c:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
n,m = [int(x) for x in input().split()]
ans = [0]*(n+1)
w = [0]*(n+1)
for _ in range(m):
    a,b = input().split()
    a = int(a)
    if ans[a] == 1:
        continue
    if b == "AC":
        ans[a] = 1
    else:
        w[a] += 1

aa = 0
ww = 0
for i in range(1,n+1):
    if ans[i]==1:
        aa += 1
        ww += w[i]
print(aa,ww)
# Judge status: Accepted
A, B, K = map(int, input().split())

a = max(A - K, 0)	#食べ残しと０とを比較して大きい方を返す
K -= A - a			#食べた分の枚数を、残りの食べる予定量から減らす
b = max(B - K, 0)	#もし負になったら０を返す

print("{} {}".format(a, b))
# Judge status: Accepted
n = int(input())
k = int(input())
x = int(input())
y = int(input())

if k < n:
    num = k*x + (n-k)*y
else:
    num = n*x
print(num)
# Judge status: Accepted
from datetime import datetime as dt
tstr = input()
tdatetime  = dt.strptime(tstr, '%Y/%m/%d')
tstr = '2019/04/30'
heiseitime = dt.strptime(tstr, '%Y/%m/%d')
if heiseitime >= tdatetime:
  print("Heisei")
else:
  print("TBD")
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
l = []
for i in range(N):
    l.append(0)
for x in A:
    l[x-1] += 1
for s in l:
    print(s)
# Judge status: Accepted
x, y = map(int, input().split())

print("Yes" if x*500 >= y else "No")
# Judge status: Wrong Answer
n, k, q = map(int, input().split())
score_list = [k-q for _ in range(n)]
for i in range(q):
    tmp = int(input())
    score_list[tmp - 1] = score_list[tmp - 1] + 1

print(score_list)
for j in score_list:
    if j > 0:
        print("Yes")
    else:
        print("No")
# Judge status: Accepted
from math import floor, ceil


n = int(input())
A = list(map(int, input().split()))

x = sum(A) / n
if abs(floor(x) - x) < abs(ceil(x) - x):
    x = floor(x)
else:
    x = ceil(x)

answer = 0
for a in A:
    answer += (a - x)**2

print(answer)
# Judge status: Accepted
x,y = map(int,input().split())
ans = 1000000000000000000000000000000
apple = 0
for i in range(1, x+1):
    apple += i+y-1
    ans = min(ans, abs(i+y-1))
#print(ans, apple)

if abs(apple-ans) <= abs(apple+ans):
    print(apple-ans)
else:
    print(apple+ans)
# Judge status: Wrong Answer
# A - Registration
def main():
    S, T = open(0).read().split()
    print("Yes" if T[:-1] == S else "No")
    print(T[:-1])


if __name__ == "__main__":
    main()
# Judge status: Accepted
# collections.counter 使い方
import collections

n=int(input())
a= list(map(int, input().split()))
c = collections.Counter(a)
d = c.most_common()
ans=0

for i in range(len(d)):
    ans+=(d[i][1]*(d[i][1]-1)//2)


for i in range(n):
    if c[a[i]]>=2:
        print(ans-c[a[i]]+1)
    else:
        print(ans)
# Judge status: Accepted
def main():
    S=input()
    if S[len(S)-1]=="s":
        print(S+"es")
    else:
        print(S+"s")

if __name__=="__main__":
    main()
# Judge status: Accepted
N, X = map(int, input().split(' '))
A = list(map(int, input().split(' ')))

cost = 0
diff = max(0, sum(A[0:2]) - X)
A[0] -= max(0, diff - A[1])
A[1] -= min(A[1], diff)
cost += diff

for i in range(2, N):
    diff = max(0, A[i - 1] + A[i] - X)
    A[i - 1] -= max(0, diff - A[i])
    A[i] -= min(A[i], diff)
    cost += diff

print(cost)
# Judge status: Accepted
#C
import math
n = int(input())
coordinate = []
for _ in range(n):
    x,y = map(int,input().split())
    coordinate.append([x,y])
dist = 0
def culc_dist(x1,y1,x2,y2):
    return (math.sqrt((x1-x2)**2 + (y1-y2)**2))
    
for i in range(n):
    for j in range(n):
        if i != j:
            dist += culc_dist(coordinate[i][0],coordinate[i][1],coordinate[j][0],coordinate[j][1])
dist /= n

print(dist)
# Judge status: Wrong Answer
# vim: fileencoding=utf-8


def main():
    n = int(input())
    ans = float("inf")
    for i in range(2, n // 2 + 1):
        a = i
        b = n - a
        na = sum(map(int, list(str(a))))
        nb = sum(map(int, list(str(b))))
        if ans > na + nb:
            ans = na + nb
    print(ans)


if __name__ == "__main__":
    main()