peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
N,K = map(int,input().split())
R,S,P = map(int,input().split())
dp = []
order = input()
def jcount(x):
  if x=='r':
    ans = P
  elif x=='s':
    ans = R
  else:
    ans = S
  return ans
counter = 0
for i in range(N):
  if i < K:
    counter += jcount(order[i])
    dp.append(order[i])
  elif order[i] != dp[i-K]:
    counter += jcount(order[i])
    dp.append(order[i])
  else:
    dp.append('x')
print(counter)
# Judge status: Accepted
idade = int(input())

if 1 <= idade <= 9:
    if idade == 3 :
        print("YES")
    elif idade == 5 :
        print("YES")
    elif idade == 7 :
        print("YES")
    else :
        print("NO")
# Judge status: Wrong Answer
import sys
 
if __name__ == '__manin__':
  
    r=sys.argv[1]
    pie=3.14
    
    area = r^2 * pie
    base_area = 1^1 * pie  
    
    print(int(area/base_area))
# Judge status: Accepted
import sys

a = int(sys.stdin.readline().strip())
print(10 - a // 200)
# Judge status: Accepted
from itertools import product

N, M = map(int, input().split())
A = [list(input()) for _ in range(N)]
B = [input() for _ in range(M)]

b = "".join(B)

ans = "No"
for i, j in product(range(N - M + 1), repeat=2):
    a = "".join(["".join(x[j:j + M]) for x in A[i:i + M]])
    if a == b:
        ans = "Yes"
        break
print(ans)
# Judge status: Accepted
# 1 <= N <= 1998
N = int(input())

if N <= 999:
    print("ABC")
elif 1000 <= N <=1998:
    print("ABD")
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
import sys
ans = 1
if 0 in a:
    print(0)
    sys.exit()
for i in a:
    if ans <= 1000000000000000000:
        ans = ans * i
      
    else:
        print(-1)
        sys.exit()
if ans <= 1000000000000000000:
    print(ans)
else:
    print(-1)
# Judge status: Accepted
N,K,S=map(int,input().split())
ans=[S]*K+[[7,S+1][S!=10**9]]*(N-K)
print(*ans)
# Judge status: Wrong Answer
#ABC051C
x1,y1,x2,y2=map(int,input().split())
for i in range(x2-x1):
    print("R",end="")
for i in range(y2-y1):
    print("U",end="")
for i in range(x2-x1):
    print("L",end="")
for i in range(y2-y1):
    print("D",end="")
print("D",end="")
for i in range(x2-x1):
    print("R",end="")
print("RU",end="")
for i in range(y2-y1):
    print("U",end="")
print("UL",end="")
for i in range(x2-x1):
    print("L",end="")
print("LD",end="")
for i in range(y2-y1):
    print("D",end="")
print("R",end="")
# Judge status: Accepted
from collections import Counter
n = int(input())
a = Counter(list(map(int, input().split())))
c = []
for i, j in a.items():
    if j >= 2:
        for _ in range(j//2):
            c.append(i)
c.sort(reverse = True)
print(c[0]*c[1] if len(c)>=2 else 0)
# Judge status: Wrong Answer
n=int(input())
A=[0]*n
for i in range(3,int(n**0.5+150)):
  for j in range(1,i-1):
    for k in range(1,i-j):
      if (x:=i*i-j*k-k*(l:=i-j-k)-l*j)<=n:
        A[x-1]+=1
print(A[-30:-1])
# Judge status: Accepted
S = input()
c1 = S[0] == "A"
c2 = S[2:-1].count("C") == 1
if c1 and c2:
    cnt = 0
    for s in S:
        if s.isupper():
           cnt += 1
    if cnt == 2:
        print("AC")
    else:print("WA")
else:
    print("WA")
# Judge status: Accepted
H,k=map(int,input().split())
h=list(map(int,input().split()))
h.sort(reverse=True)
for i in range(min(H,k)):
    h[i]=0
print(sum(h))
# Judge status: Accepted
N, M, X = map(int, input().split())
A = [list(map(int, input().split())) for i in range(N)]

final = 1000000000

for i in range(1, 2**N):
    ans = 0
    rikai = [0]*M
    for j in range(N):
        if ((i >> j) & 1):
            for k in range(1, M+1):
                rikai[k-1] += A[j][k]
            ans += A[j][0]
    if all(el >= X for el in rikai):
        final = min(final, ans)

if final == 1000000000:
    print(-1)
else:
    print(final)
# Judge status: Accepted
U=list(str(input()))
if "N" in U:
  if "S" not in U:
    print("No")
    exit()
if "S" in U:
  if "N" not in U:
    print("No")
    exit()
if "E" in U:
  if "W" not in U:
    print("No")
    exit()
if "W" in U:
  if "E" not in U:
    print("No")
    exit()
print("Yes")
# Judge status: Accepted
def actual(X, A, B):
    is_unexpired = (A - B)

    if is_unexpired >= 0:
        return 'delicious'

    elapsed_after_expiration_day = (B - A)
    if elapsed_after_expiration_day <= X:
        return 'safe'

    return 'dangerous'

X, A, B = map(int, input().split())
print(actual(X, A, B))
# Judge status: Wrong Answer
N = input()
N = int(N)
num_paper = N / 2
if (N % 2) > 0:
  num_paper += 1
else:
  pass

print(num_paper)
# Judge status: Wrong Answer
sw=input()
sw_split=sw.split(" ")

if sw_split[1] >= sw_split[0]:
    print("unsafe")
else:
    print("safe")
# Judge status: Accepted
a,b,k = map(int, input().split())

if 2*k < b-a:
    for i in range(a, a+k):
        print(i)
    for i in range(b-k+1, b+1):
        print(i)
else:
    for i in range(a, b+1):
        if (a <= i and i < a+k) or (b-k < i and i <= b):
            print(i)
# Judge status: Accepted
X = int(input())

for i in range(-1000, 1001):
    for j in range(-1000, 1001):
        if i**5 - j**5 == X:
            print(i, j)
            exit()
# Judge status: Accepted
# coding: utf-8


def solve(*args: str) -> str:
    n = int(args[0])
    A = list(map(int, args[1].split()))

    rem = sum(A)
    cur = 1
    ret = 0
    for a in A:
        cur = min(rem, cur)
        rem -= a
        ret += cur
        cur = 2*(cur-a)
        if cur < 0:
            ret = -1
            break

    return str(ret)


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))
# Judge status: Wrong Answer
n,m,x=map(int,input().split())
c=[]
a=[]
for i in range(n):
  tmp = list(map(int, input().split()))
  c.append(tmp[0])
  a.append(tmp[1:])
  
result = -1
for i in range(2**n):
  skill = [0]*m
  cost = 0
  for j in range(m):
    if (i >> j) & 1 == 0:
      continue
    cost += c[j]
    for s in range(m):
      skill[s] += a[j][s]
      
  if all(s >= x for s in skill):
    if result == -1:
      result = cost
    else:
      result = min(result,cost)
print(result)
# Judge status: Accepted
n, k = map(int, input().split())
a = list(map(int,input().split()))
dict = {}
for i in a:
	if i in dict:
		dict[i] += 1
	else:
		dict[i] = 1
dict2 = sorted(dict.items(), key=lambda x:x[1], reverse=True)
c = 0
flg = 0
d = 0
for i in dict2:
	if c >= k:
		flg = 1
	if flg == 1:
		d += i[1]
	c += 1
print (d)
# Judge status: Wrong Answer
N = int(input())
s = ''
while N != 0:
    m = N%2
    s += str(m)
    N = (N - m)*(-1)//2
print(s[::-1])
# Judge status: Accepted
import math

N = int(input())
n = int(math.sqrt(N))
print(n ** 2)
# Judge status: Wrong Answer
a,b,c,d = map(int,input().split())

bc = b//c
bd = b//d

import math
bcd = c*d/math.gcd(c,d)

ac = (a-1)//c
ad = (a-1)//d
acd = (a-1)//math.gcd(c,d)

ans = (b-(bc-bd+bcd))-(a-1-(ac-ad+acd))

print(int(ans))
# Judge status: Wrong Answer
def resolve():
    a, b, c = map(int, input().split())
    ans = 0
    if a == b == c:
        print(-1)
        exit()
    if a%2 != 0 or b%2 != 0 or c%2 != 0:
        print(ans)
        exit()
    while (a%2 == 0 and b%2 == 0 and c%2 == 0):
        a, b, c = (b+c)//2, (a+c)//2 , (a+b)//2
        ans += 1
    print(ans)
resolve()
# Judge status: Wrong Answer
N, T = map(int,input().split())
mincost = 1001
for i in range(1, N+1):
    c, t = map(int,input().split())
    if t <= T:
        cost = c
        if cost < mincost:
            mincost = cost

if mincost == 1000:
  print('TLE')
if mincost < 1000:
  print(mincost)
# Judge status: Accepted
h=input()
if(h[2]==h[3] and h[4]==h[5]):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n,r=map(int,input().split())
if n<=10:
  a=100*(10-n)+r
else:
  a=r
print(a)
# Judge status: Wrong Answer
import numpy as np
n = int(input())
A = list(map(int, input().split()))

A = np.array(A)

x = np.argsort(A) + 1

print(x)
# Judge status: Accepted
# -*- coding: utf-8 -*-
x = int(input())
m = 100

for i in range(10 ** 18):
  if m >= x:
    print(i)
    break
  m = int(m * 1.01)
# Judge status: Accepted

n = int(input())

if 400 <= n <= 599:
    print(8)
elif 600 <= n <= 799:
    print(7)
elif 800 <= n <= 999:
    print(6)
elif 1000 <= n <= 1199:
    print(5)
elif 1200 <= n <= 1399:
    print(4)
elif 1400 <= n <= 1599:
    print(3)
elif 1600 <= n <= 1799:
    print(2)
elif 1800 <= n <= 1999:
    print(1)
# Judge status: Wrong Answer
N,M = map(int,input().split())
A = [1 for _ in range(N+1)]
B = [0 for _ in range(N+1)]
B[1] = 1
cnt = 1
for _ in range(M):
    a,b = map(int,input().split())
    if B[a]==1 and A[a]>0:
        A[a] -= 1
        if A[a]==0:
            cnt -= 1
            B[a] = 0
        A[b] += 1
        if B[b]==0:
            B[b] = 1
            cnt += 1
print(cnt)
# Judge status: Accepted
a,b=map(str,input().split())

print(b+a)
# Judge status: Accepted
# import math
# from itertools import permutations as permus
# from fractions import gcd
# from collections import deque,Counter

import numpy as np
# import scipy as scp

# 入力の受け取り
n = int(input())
# 配列入力の受け取り
arrA1 = np.array(input().split(),dtype=np.int64)
arrA2 = np.array(input().split(),dtype=np.int64)

ans = 0
for i in range(1,n+1):
    res = sum(arrA1[0:i])+sum(arrA2[i-1:n])
    ans = max(ans,res)

print(ans)
# Judge status: Wrong Answer
import sys


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

a, b, k = inintm()

if b-a+1 <= 2*k:
    for i in range(a,b+1):
        print(i)
    exit()

l = b-k+1
cnt = 0

for i in range(a,b+1):
    cnt += 1
    l -= 1
    if cnt <= k:
        print(i)
    elif l <= k:
        print(i)
# Judge status: Accepted
a,b,c,d = map(int, input().split())
x =[i for i in range(a,b+1)]
y =[j for j in range(c,d+1)]

z = len(x+y) - len(set(x+y))
if z == 0:
    print(0)
else:
    print(z-1)
# Judge status: Accepted
n, m = map(int, input().split())
c = [[] for i in range(n)]
d = [0]
e = [-1]*n
for i in range(m):
    a, b = map(int, input().split())
    c[a-1].append(b-1)
    c[b-1].append(a-1)
while d:
    f = d.pop(0)
    for i in c[f]:
        if e[i] == -1:
            d.append(i)
            e[i] = f
print("Yes")
for i in range(n-1):
    print(e[i+1]+1)
# Judge status: Accepted
import sys


# \n
def input():
    return sys.stdin.readline().rstrip()


def main():
    N = int(input())
    T, A = map(int, input().split())
    H = list(map(int, input().split()))
    lc= 10**6

    for i in range(N):
        c = T - H[i] * 0.006
        if abs(A-c)<lc:
            lc=abs(A-c)
            n= i

    print(n+1)




if __name__ == "__main__":
    main()
# Judge status: Accepted
import numpy
d = int(input())
c = list(map(int,input().split()))
s = [0]*d
for i in range(d):
    s[i] = list(map(int,input().split()))
for i in range(d):
    max_index = numpy.argmax(s[i])
    print(max_index+1)
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline

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

s=input()
count=0
for i in range(3):
    #print(s[i:i+1])
    if s[i:i+1]==s[i+1:i+2]:
        count+=1
if count>0:
    print("bad")
else:
    print("good")
# Judge status: Accepted
s = input()

#個数の初期化
sum = 0

#全探索
for i in range(len(s)):
    if s[i] == '1':
        sum += 1

print(sum)
# Judge status: Accepted
a,b,c,d = map(int,input().split())
cnt = 0
for i in range(101):
    if a <= i < b and c <= i < d:
        cnt += 1
print(cnt)
# Judge status: Accepted
A, B, C = map(int, input().split())

if B // A > C:
    print(C)
else:
    print(B // A)
# Judge status: Accepted
a = list(input().split())

print(a[0][0] + a[1][0] + a[2][0])
# Judge status: Accepted
import collections

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


c = collections.Counter(A)

z = []
for k, v in c.items():
    if v >= 4:
        z.append(k)
    if v >= 2:
        z.append(k)

if len(z) < 2:
    print(0)
    exit()

x = max(z)
del z[z.index(x)]
y = max(z)

print(x*y)
# Judge status: Accepted
import sys
import numpy as np
input = sys.stdin.buffer.readline
N = int(input())
A = np.array(list(map(int, input().split())))

B = np.array([0] * N)
for i in range(len(A), 0, -1):
    v = B[2 * i - 1::i].sum() % 2
    if A[i - 1] != v:
        B[i - 1] = 1
# print(f'{B=}')

M = B.sum()
print(M)
idx = np.where(B == 1)[0] + 1
print(*idx, sep=' ')
# Judge status: Wrong Answer
N = int(input())
a=0
cnt = 0
num = N
while 10<=num:
  num/=10;a+=1
if a%2==0:
  for i in range(10**a,N+1):
    cnt += 1
if 4 < a:
  print(cnt + 90909)
elif 2 < a:
  print(cnt + 909)
else:
  print(cnt + 9)
# Judge status: Accepted
N = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

plus, minus = 0, 0
for i in range(N):
  if a[i]-b[i] >= 0:
    minus += a[i]-b[i]
  else:
    m = b[i]-a[i]
    plus += (m+1) // 2
    if m%2 == 1:
      minus += 1
    
if plus >= minus:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    n,m=INTM()
    road=[]
    for i in range(m):
        a,b=INTM()
        road.append(a)
        road.append(b)
    for i in range(n):
        ct=road.count(i+1)
        print(ct)
if __name__ == '__main__':
    do()
# Judge status: Wrong Answer
N,K=map(int,input().split())
H=[int(input()) for _ in range(N)]
H.sort(reverse=True)
ans=10**6

for i in range(N-K):
    ans=min(ans,H[i]-H[i+K-1])

print(ans)
# Judge status: Accepted
n = int(input())
d = list(map(int, input().split()))
if d[0]!=0:
    print(0)
    exit()
node = [0]*(max(d)+1)
for i in d:
    node[i] += 1
if node[0]>1:
    print(0)
    exit()
ans = 1
for i in range(len(node)-1):
    ans *= node[i]**node[i+1]
    ans %= 998244353
print(ans)
# Judge status: Wrong Answer
S,T=map(list,input().split())
A,B=map(int,input().split())
U=(input())
if U=="red":
  print(A-1,B)
else:
  print(A,B-1)
# Judge status: Accepted
l = [int(input()) for i in range(3)]
print((l[0]+l[1])*l[2]//2)
# Judge status: Accepted
N = int(input())
A = [0]
A.extend(list(map(int, input().split())))

for i in range(1, N//2 + 1)[::-1]:
    wa = 0
    for j in range(2, N+1):
        if i * j > N:
            break
        wa += A[i*j]
    wa %= 2
    if A[i] == wa:
        A[i] = 0
    else:
        A[i] = 1


A = A[1:]
print(A.count(1))
for i, j in enumerate(A):
    if j == 1:
        print(i+1, end=' ')
# Judge status: Accepted
n,k=map(int,input().split())
print(min(n%k,abs((-1*n)%k)))
# Judge status: Accepted
s = input()
s = sorted(s)
v = ['a','b','c']
if s == v: print('Yes')
else: print('No')
# Judge status: Wrong Answer
def main():
    n = int(input())
    count = 0
    x_list =[3**3*5, 3**3*7, 3*5*7, 3*5*11]
    for one in x_list:
        if one<=n:
            count+=1
    print(count)

if __name__=="__main__":
    main()
# Judge status: Accepted
n=int(input())
su=0
su=(n//500)*1000
n=n%500
s1=n//5
su=su+s1*5
print(su)
# Judge status: Accepted
a, b = map(int, input().split())

ave = (a + b) / 2  # float
if ave - int(ave) > 0:
  print(int(ave)+1)
else:
  print(int(ave))
# Judge status: Accepted
# -*- coding: utf-8 -*-

import math

a,b=input().split()
n=int(a+b)

if math.sqrt(n)-int(math.sqrt(n))==0.0:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
a = int(input())
b = int(input())
h = int(input())

S = ((a + b) * h) / 2

print(str(S))
# Judge status: Wrong Answer
sx, sy, tx, ty = map(int, input().split())
s = ""
dx, dy = abs(tx - sx), abs(ty - sy)
dxy = dx + dy
for a in range(dx):
  s += "R"
for b in range(dy):
  s += "U"
for c in range(dx):
  s += "L"
for d in range(dy):
  s += "D"
s += "D"
for e in range(dx + 1):
  s += "R"
for f in range(dy + 1):
  s += "U"
s += "U"
for g in range(dx + 1):
  s += "L"
for h in range(dy + 1):
  s += "D"
s += "R"
print(s)
# Judge status: Accepted
x=int(input())
y=x//15
print(x*800-y*200)
# Judge status: Accepted
n=int(input())
a=[int(x) for x in input().rstrip().split()]
dic={}
minus=0
for i in a:
  if i not in dic:
    dic[i]=1
  else:
    dic[i]+=1

for i in dic:
  v=dic[i]
  if i==v:
    continue
  elif i<v:
    minus+=v-i
  else:
    minus+=v

print(minus)
# Judge status: Wrong Answer
s = input()

if sorted(s) == "abc":
  print("Yes")
else:
  print("No")
# Judge status: Accepted
n = int(input())
P = list(map(int,input().split()))
ans = 0
for i in range(n - 1):
    if i+1 == P[i]:
        ans += 1
        P[i],P[i+1] = P[i+1],P[i]
if P[n-1] == n:
    ans += 1
print(ans)
# Judge status: Accepted
import math
N,X=map(int,input().split())
x=list(map(int,input().split()))
x.append(X)
x.sort()
diff=[x[i+1]-x[i] for i in range(N)]

ans=diff[0]

for i in range(1,N):
    ans=math.gcd(ans,diff[i])

print(ans)
# Judge status: Accepted
x,y = list(map(int,input().split()))
print(x+y//2)
# Judge status: Accepted
N=int(input())
L=[]
for i in range(N):
    x,l=map(int,input().split())
    a,b=x-l,x+l
    L.append((a,b))
L.sort(key=lambda  ab: ab[1])
#print(L)
robot=1
b=L[0][1]
for i in range(1,N):
    A,B=L[i]
    if A>=b:
        robot+=1
        b=B
print(robot)
# Judge status: Accepted
import math
r = int(input())
print(2 * math.pi * r)
# Judge status: Accepted
n = int(input())
s = str(input())
t = str(input())

temp = 0
for i in range(n+1):
    if t[0:i] == s[n-i:n]:
        temp = i

ans = 2*n-temp
print(ans)
# Judge status: Accepted
n,m,x,y=list(map(int,input().split()))
X=list(map(int,input().split()))
Y=list(map(int,input().split()))
ans='War'
for i in range(x+1,y):
  if max(X)<i and i<=min(Y):
    ans='No War'
print(ans)
# Judge status: Accepted
k,s=map(int,input().split())
cnt=0
for i in range(k+1):
    for j in range(k+1):
        if 0 <= s-i-j <= k:
            cnt+=1
print(cnt)
# Judge status: Wrong Answer
input_line = int(input())
#print(input_line)

first=input_line%10
print(first)

if first == 2 or first == 4 or first == 5 or first == 7 or first == 9:
    print("hon")
elif first == 0 or first == 1 or first == 6 or first == 8:
    print("pon")
elif first == 3:
    print("bon")
# Judge status: Accepted
n = int(input())
print((n + 1) // 2)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

happy = 0
for i in range(N):
    happy += B[A[i]-1]

for j in range(N-1):
    if A[j+1] - A[j] == 0:
        happy +=  C[A[j]-1]

print(happy)
# Judge status: Wrong Answer
n,x,t=map(int,input().split())
c=0
while c<=n:
    c+=t

print(c//t)
# Judge status: Wrong Answer
a,b,x = map(int, input().split())

if a<= x <= a+b:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))

if n % 2 == 0:
    x = n//2
    for i in range(x):print(a[(n-1)-(2*i)])
    for i in range(x):print(a[2*i])
else:
    x = n//2 + 1
    for i in range(x):print(a[(n-1)-(2*i)])
    for i in range(x-1):print(a[(2*i)+1])
# Judge status: Wrong Answer
n=int(input())
s=1
for a in range(n):
    for b in range(n):
        for c in range(n):
            for i in range(n):
                if i==0:
                    continue
                if a%i==0 and b%i==0 and c%i==0:
                    g = i
                s+=g

print(s)
# Judge status: Accepted
a,b,c = map(int, input().split())
k = int(input())
m = max(a,b,c)
for _ in range(k):
  m*=2
if max(a,b,c)==a: print(m+b+c)
elif max(a,b,c)==b: print(a+m+c)
else: print(a+b+m)
# Judge status: Accepted
a,b,c=map(int,input().split())
k=int(input())
while a>=b:
    b*=2
    k-=1
while b>=c:
    c*=2
    k-=1
print(["No","Yes"][k>=0])
# Judge status: Wrong Answer
S = input()
S_list = list(S)

for i in range(len(S_list)):
  S_list[i] = "x"

S = str(S_list)
  
  
print(S)
# Judge status: Wrong Answer
a,b,c = map(int,input().split())
k = int(input())
res = True
for i in range(k):
    if b > a:
        if c > b:
            break
        else:
            c *= 2
    elif b < a:
        b *= 2
res = a < b < c
if res:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n=int(input())
a=[]
for i in range(n):
  ai=int(input())
  a.append(ai)
b=[a[n-1]]
for i in reversed(range(n-1)):
  if a[i]>=b[-1]:
    b.append(a[i])
  else:
    for j in b:
      if j>a[i]:
        j=a[i]
        break
print(len(b))
# Judge status: Wrong Answer
import sys

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

if K == 10:
    print(len(str(N)))
    sys.exit()

p = 0
while True:
    num = K ** p
    if N <= num:
        break
    p += 1

print(p)
# Judge status: Accepted
import sys
input = lambda: sys.stdin.readline().rstrip("\r\n")

n = int(input())

def num_divisors_table(n):
    table = [0] * (n + 1)
    
    for i in range(1, n + 1):
        for j in range(i, n + 1, i):
            table[j] += 1
    
    return table

table = num_divisors_table(n)
ans = 0
for i in range(1, n + 1, 2):
    if table[i] == 8:
        ans += 1
print(ans)
# Judge status: Accepted
n = int(input())
def rec(a):
  if a == 1:
    return 1
  else:
    return a + rec(a - 1)
  
print(rec(n))
# Judge status: Wrong Answer
a=int(input())
lst=list(map(int,input().split()))
print(a,lst)
cnt=0
for i in range(0,a,2):
    if (lst[i] % 2==1) :
        cnt+=1
print(cnt)
# Judge status: Accepted
a,b=map(int,input().split())
if a==1 or b == 1:
  print(1)
else:
  print((a*b+1)//2)
# Judge status: Accepted
def main():
    w = input()
    lst = [0] * 26

    for c in w:
        lst[ord(c) - ord("a")] += 1

    for num in lst:
        if num % 2 != 0:
            print("No")
            break
    else:
        print("Yes")


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

ans=v[0]
for i in range(1,N):
    ans=(ans+v[i])/2
print(ans)
# Judge status: Accepted
N, M, K = map(int, input().split())
if K % N == 0 or K % M == 0:
    print('Yes')
    exit()
candidates = set()
for i in range(1, N):
    curr = i * M
    for j in range(1, M):
        curr += N - 2 * i
        candidates.add(curr)
for j in range(1, M):
    curr = j * N
    for i in range(1, N):
        curr += M - 2 * j
        candidates.add(curr)
print('Yes') if K in candidates else print('No')
# Judge status: Wrong Answer
N = int(input())
A = [tuple(map(int, input().split())) for _ in range(N)]
ans = []
import numpy as np
for i in range(len(A)-1):
    for k in range(i+1,len(A)):
        print(i, k)
        ans.append(np.sqrt(((A[i][0]-A[k][0])**2)+(A[i][1]-A[k][1])**2))
print(sum(ans)*2/N)
# Judge status: Accepted
import numpy
N = int(input())
A = list(map(int, input().split()))

res = []
res.append(A[0])
for i in range(len(A)-1):
    res.append(res[i] + A[i+1])

sum = 0
for i in range(N-1):
    sum += A[i] * (res[N - 1] - res[i])

print(sum % (10**9+7))
# Judge status: Accepted
a = int(input())
s = input()
if a >= 3200:
	print(s)
else:
	print('red')
# Judge status: Accepted
A,B,C,D=map(int,input().split())
if B<=C or D<=A:
    print(0)
else:
    X=[A,B,C,D]
    X=sorted(X)
    print(X[2]-X[1])
# Judge status: Accepted
input()
from collections import *
c=Counter(map(int,input().split()))
a=0
r=sorted(-k for k,v in c.items() if v>1)
if len(r)>1: a=r[0]*r[1]
s=sorted(-k for k,v in c.items() if v>3)
if s: a=max(a,s[0]**2)
print(a)
# Judge status: Wrong Answer
n=int(input())
g=0
for i in range(n):
  a,b=map(int,input().split(" "))
  if a==b:
    g=g+1
    if g==3:
      break
      break
  else:
    g=0
print(g)
if g==3:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
n = int(input())
a = input().split()

b = []

for i in a:
    b.append(i)
    b.reverse()

print("".join(b))
# Judge status: Accepted
a=input()
b=input()
x=''
for i in range(len(b)):
  x+=a[i]
  x+=b[i]
if len(a)==len(b):
  print(x)
else:
  print(x+a[-1])
# Judge status: Accepted
X = int(input())

for b in range(-10**3,10**3):
  z = X + b**5 
  for a in range(-10**3,10**3):
    if a**5 == z:
      print(a,b)
      exit()
# Judge status: Accepted
a,b = map(int,input().split())
if a * b % 2 == 0:
    print("Even")
else:
    print("Odd")
# Judge status: Accepted
k = int(input())
odd = k // 2
print(odd * (k - odd))
# Judge status: Accepted
A, s, C = input().split()
print("A"+ s[0] + "C")