peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
st = input()

n = len(st)
half = (n-1)//2

if st[0:half] == st[n-1:half:-1]:
  if half%2 == 0:
    qu = half//2
    if st[:qu] == st[half-1:qu-1:-1] and st[half+1:half+qu+1] == st[n-1:half+qu:-1]:
      print("Yes")
    else:
      print("No")  
  else:
    qu = (half-1)//2
    if st[:qu] == st[half-1:qu:-1] and st[half+1:half+qu+1] == st[n-1:half+qu+1:-1]:
      print("Yes")
    else :
      print("No") 

else:
  print("No")
# Judge status: Accepted
n = int(input())
s = input()
if s[:n//2:] == s[n//2::]:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N, M = map(int, input().split())

li = [0] * M

for i in range(N):
    K = list(map(int, input().split()))
    for j in range(1, len(K)):
        li[K[j]-1] += 1

print(li.count(N))
# Judge status: Accepted
# Problem B - Training Camp

# input process
N = int(input())

# initialization
frac_num = 1
INF = 10**9 + 7

for i in range(1, N+1):
    frac_num = (frac_num * i) % INF

print(frac_num%INF)
# Judge status: Accepted
import numpy as np
n,*a = map(int,open(0).read().split())
a = np.array(a)
mod = 10**9+7
ans = 0
for i in range(61):
  b = np.count_nonzero(a>>i&1)
  ans += b*(n-b)*1<<i
print(ans%mod)
# Judge status: Wrong Answer
n = int(input())
apple = []
for _ in range(n):
    apple.append(int(input()))
big = max(apple[1:n+1])
print(big)
for i in range(1, n):
    if apple[i] != big:   
        if apple[i-1] >= big:
            print(apple[i-i])
            big = apple[i-1]
        else:
            print(big)
    else:
        orange = apple[0:i] + apple[i+1:n]
        print(max(orange))
        big = max(orange)
# Judge status: Accepted
n, k = map(int, input().split())
h = list(map(int, input().split()))
h.sort()
print(sum(h[:max(0, len(h) - k)]))
# Judge status: Accepted
import sys
a = [1]
for i in range(2,34):
    for j in range(2,13):
        if i**j <= 1000 : 
            a.append(i**j)   
x = int(input())
for k in range(x,0,-1):
    if k in a:
        print(k)
        sys.exit()
# Judge status: Accepted
x = int(input())

print("1" if x == 0 else "0")
# Judge status: Accepted

import collections

def main():
    n = int(input())
    A = sorted(map(int, input().split()))

    D = collections.defaultdict(int)
    for a in A:
        D[a] += 1

    m = max(A)
    S = set()

    ans = 0
    for i in range(n):
        a = A[i]

        if a in S:
            continue

        if D[a] == 1:
            ans += 1

        num = a
        while num <= m:
            S.add(num)
            num += a

    print(ans)


main()
# Judge status: Accepted
N,M,X,Y=map(int,input().split())
XL=sorted(list(map(int,input().split())))
YL=sorted(list(map(int,input().split())))
ans = 'War'

for Z in range(X+1,Y+1):
    if XL[-1]<Z and Z<=YL[0]:
        ans = 'No War'
        break

print(ans)
# Judge status: Wrong Answer
n,m = map(int,input().split())
a = 1
b = 2
for i in range(m):
  print(a,b)
  a = a + 1
  b = b + i + 2
# Judge status: Wrong Answer
import re
flag = re.match('^(deram|dreamer|erase|eraser)+$',input())
if flag:
    print('YES')
else:
    print('NO')
# Judge status: Wrong Answer
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))

a = [0] + a
now = 1
cities = [now]
done = set()
for i in range(n):
    now = a[now]
    if now in done:
        break
    done.add(now)
    cities.append(now)
idx_s = cities.index(now)
f = (len(cities) - idx_s)
d = k - idx_s
idx = d%f
ans = cities[idx + idx_s]
print(ans)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

result = 1
ok = True
if 0 in A:
    result = 0
else:
    for a in A:
        result *= a
        if result > 10 ** 18:
            ok = False
            break

if ok:
    print(result)
else:
    print(-1)
# Judge status: Accepted
from random import randint

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):
    print(randint(1,26))
# Judge status: Accepted
S=input()
if S[-1] == 's': print(S+'es')
else: print(S+'s')
# Judge status: Accepted
N = int(input())
s = input()
t = input()

for i in range(N, 0, -1):
    # print(i)
    # print(s[-i:])
    # print(t[:i])
    if s[-i:] == t[:i]:
        print(2 * (N - i) + i)
        exit()
print(2 * N)
# Judge status: Accepted
import math

x = int(input())
ab = [list(map(int, input().split())) for i in range(x)]

A=[]
B=[]
for i in range(x):
    A.append(ab[i][0])
    B.append(ab[i][1])

A.sort()
B.sort()

if x%2==1:
    min=A[x//2]
    max=B[x//2]
    ans=max-min+1
else:
    min=(A[x//2-1]+A[x//2])/2
    max=(B[x//2-1]+B[x//2])/2
    ans=(max-min)*2+1

print(int(ans))
# Judge status: Accepted
S = input()
for i in range(9):
    hikaku = str(i)+str(i)+str(i)
    #print(hikaku)
    if (hikaku in S) == True:
        result = "Yes"
        break
    else:
        result = "No"
print(result)
# Judge status: Wrong Answer
import copy
n = int(input())
r = []
for _ in range(n):
    city, x = input().split()
    x = int(x)
    r.append((city, x))

d = copy.deepcopy(r)
d = sorted(d, key=lambda x: -x[1])
d = sorted(d, key=lambda x: x[0])

print(d)
for k in d:
    print(r.index(k) + 1)
# Judge status: Wrong Answer
n = int(input())
for i in range(n):
  if int(i * 1.08) == n:
    print(i)
    exit()
print(":(")
# Judge status: Accepted
a = [input().split() for _ in range(3)]
n = int(input())
b = [input() for _ in range(n)]

p = []
p += a
p += [list(a_) for a_ in zip(*a)]
p += [[a[x][x] for x in range(3)]]
p += [[a[x][2-x] for x in range(3)]]

for p_ in p:
    for x in p_:
        if x in b:
            continue
        else:
            break
    else:
        print('Yes')
        break
else:
    print('No')
# Judge status: Accepted
l = [[0.25],[0.5],[1],[2]]
tmp = list(map(int,input().split()))

for i in range(4):
    l[i].append(tmp[i])

for i in range(4):
    l[i].append(l[i][1]*4/(l[i][0]*4))

from operator import itemgetter
l = sorted(l, key=itemgetter(2))

ans = 0
n = 4*int(input())
for i in range(4):
    tmp = n//int(l[i][0]*4)
    if tmp >= 1:
        ans += tmp * l[i][1]
        n -= tmp*int(l[i][0]*4)

print(int(ans))
# Judge status: Accepted
S = [input() for _ in range(3)]
t = 0
i = [0, 0, 0]
while len(S[t]) > i[t]: 
    tmp = t
    if S[t][i[t]] == "a":
        t = 0
    elif S[t][i[t]] == "b":
        t = 1
    else:
        t = 2
    i[tmp] += 1
if t == 0:
    ans = "A"
elif t == 1:
    ans = "B"
else:
    ans = "C"
print(ans)
# Judge status: Wrong Answer
from bisect import bisect

n,q=map(int,input().split())
s=input()
l=[]
r=[]
for i in range(q):
	L,R=map(int,input().split())
	l.append(L)
	r.append(R)

a=[]
c=[]
for i in range(n-1):
	if s[i:i+2]=='AC':
		a.append(i)
		c.append(i)

for i in range(q):
	print(bisect(c,r[i])-bisect(a,l[i])+1)
# Judge status: Accepted
a,b = map(int, input().split())
s = input()
count = 0
ans = 'Yes'
for i in range(a+b+1):
  if i == a:
    if s[i] != '-':
      ans = 'No'
      break
  else:
    if s[i] == '-':
      ans = 'No'
      break
print(ans)
# Judge status: Wrong Answer
s = input()
t = input()
d = {}
for i in range(len(s)):
  if t[i] in d:
    if d[t[i]] != s[i]:
      print("No")
      break
  else:
    d[t[i]] = s[i]
print("Yes")
# Judge status: Wrong Answer
N=int(input())
a = list(map(int, input().split()))
import fractions
ans = a[0]
for i in range(1, N):
    ans = ans * a[i] // fractions.gcd(ans, a[i])
import numpy as np
aa = np.array(a)
print(sum((ans//aa)%(10**9+7)))
# Judge status: Accepted
k,n,*a=map(int,open(0).read().split())
a+=[a[0]+k]
d=[abs(a[i]-a[i+1]) for i in range(n)]
print(k-max(d))
# Judge status: Accepted
a,b=input().split()
print(int(a)-(a>b))
# Judge status: Accepted
N = int(input())
original = N

cnt = 0
while N >= 10:
    N //= 10
    cnt += 1
    #print(N)
temp = (N+1) * 10 ** cnt - 1
temp2 = N * 10 ** cnt - 1
#print(temp)
#print(temp2)
if temp == original:
    print(sum(list(map(int, list(str(temp))))))
else:
    print(sum(list(map(int, list(str(temp2))))))
# Judge status: Accepted
def main():
    n = int(input())
    s = input()
    white = s.count(".")
    ans, black = white, 0
    for i in range(n):
        if s[i] == ".":
            white -= 1
        else:
            black += 1
        tmp = black + white
        if tmp < ans:
            ans = tmp
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)

i_i = lambda: int(i_s())
i_l = lambda: list(map(int, stdin.readline().split()))
i_s = lambda: stdin.readline().rstrip()

L = i_i()

ans = 0
for x in range(L):
    for y in range(L):
        z = L - x - y
        if z > 0 and x * y * z > ans:
            ans = x * y * z

print(ans)
# Judge status: Accepted
x, y = map(int, input().split())
if x%y == 0:
  print(-1)
else:
  print(x)
# Judge status: Accepted
N, K, S = map(int, input().split())

M = 1000000000
_S = M - 1 if S == M else M
print(' '.join(list(map(str, [S] * K + [_S] * (N - K)))))
# Judge status: Wrong Answer
import fractions

a, b = map(int, input().split())

print(a * b / fractions.gcd(a, b))
# Judge status: Wrong Answer
ans = 0
n = int(input())
w = list(map(int,input().split()))
mid = sum(w)//2
ans = 0
for i in w:
    ans += i
    if mid <= ans:
        print(abs(ans-(sum(w)-ans)))
        break
# Judge status: Accepted
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under
mod=10**9+7
s=int(input())
a=s//3
ans=0
for i in range(1,a+1):
    t=s-3*i
    ans+=cmb(t+i-1,i-1)%mod
print(ans%mod)
# Judge status: Accepted
s=input()
ans=0
mae=""
now=""
for i in s:
	now += i
	if mae != now:
		ans += 1
		mae = now
		now = ""
print(ans)
# Judge status: Wrong Answer
def solve():
  ans = 0
  for a in range(1, N):
    for b in range(1, N):
      x = a * b
      if x >= N:
        break
        ans += 1
        return ans

N = int(input())
ans = solve()
print(ans)
# Judge status: Accepted
def main():
    n, target = map(int, input().split())
    count = {}
    numbers = list(map(int, input().split()))
    for num in numbers:
        if num in count:
            count[num] += 1
        else:
            count[num] = 1
    count = sorted(count.values())
    print(sum(count[:-target]) if len(count) > target else 0)


if __name__ == '__main__':
    main()
# 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)
ans=ans[::-1]
print(ans[K-1])
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
if (b - a) == (c - b):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
N,K,S = map(int,input().split())
A = [10**9]*N
if S != 10**9:
    for i in range(K):
        A[i] = S
else:
    for i in range(N-K):
        A[i] = 10**9-1
print(*A)
# Judge status: Wrong Answer
n, m = map(int, input().split())
num = [1] * n
red = [0] * n
red[0] = 1

for i in range(m):
    x, y = map(int, input().split())
    x -= 1
    y -= 1
    if red[x] and num[y]:
        red[y] = 1
    num[x] -= 1
    num[y] += 1

ans = 0
for i in range(n):
    if num[i] and red[i]:
        ans += 1
print(ans)
# Judge status: Accepted
if __name__ == "__main__":
    s = input()
    k = int(input())

    s_num = [0] * len(s)
    res = k
    for i in range(len(s)):
        tmp = ord(s[i]) - 97
        if tmp != 0 and 26 - tmp <= res:
            res -= (26 - tmp)
            s_num[i] = 0
        else:
            s_num[i] = tmp

    res %= 26

    s_num[-1] += res

    ans = ''
    for i in s_num:
        ans += chr(i + 97)

    print(ans)
# Judge status: Wrong Answer
A = input()
B = input()

for i in range(len(B)):
    if A[i] != 1:
        print(A[i])
        break
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
res = 10**9
for i in range(-100,101):
	ans = 0
	for j in a:
		ans += (abs(i-j))**2
	res = min(res,ans)
print (res)
# Judge status: Wrong Answer
# ABC102C

import numpy as np
n = int(input())
a = [int(x) for x in input().split()]
a = np.array(a)
Min = np.inf
for b in range(100000):
    x = b+np.arange(1, n+1)
    Min = min(Min, sum(abs(a - x)))
print(Min)
# Judge status: Accepted
from collections import defaultdict
n = int(input())
a_list = [int(x) for x in input().split()]
d = defaultdict(int)
for a in a_list:
    d[a] += 1
temp_list = sorted([(k, v) for k, v in d.items() if v >= 2], reverse=True)
if len(temp_list) >= 2:
    print(temp_list[0][0] ** 2 if temp_list[0][1] >= 4 else temp_list[0][0] * temp_list[1][0])
else:
    print(0)
# Judge status: Wrong Answer
a=int(input())

print(2*a*6.28318530717958623200)
# Judge status: Wrong Answer
import math
s=list(input())
a=[]
for i in range(len(s)-2):
  p=100*int(s[i])+10*int(s[i+1])+int(s[i])
  a.append(abs(p-753))
print(min(a))
# Judge status: Wrong Answer
n = int(input())
A = list(map(int,input().split()))
A.sort()
a = sum(A[n//3:n//3*2])
b = sum(A[-2:-2-n//3*2:-2])
c = sum(A[1:n+1:2])
ans = max(a,b,c)
print(ans)
# Judge status: Accepted
n, m = map(int, input().split())
dp = [0 for i in range(n + 1)]
mod = 10 ** 9 + 7
broke = set()
for i in range(m):
    broke.add(int(input()))
dp[0] = 1
for i in range(n):
    if i + 1 <= n and i + 1 not in broke:
        dp[i + 1] += dp[i]
        dp[i + 1] %= mod
    if i + 2 <= n and i + 2 not in broke:
        dp[i + 2] += dp[i]
        dp[i + 2] %= mod
print(dp[-1] % mod)
# Judge status: Accepted
n, m = map(int, input().split())

print(int(n*(n-1)/2+m*(m-1)/2))
# Judge status: Accepted
import sys
# sys.setrecursionlimit(100000)


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


def input_int():
    return int(input())


def input_int_list():
    return [int(i) for i in input().split()]


def main():
    n, k = input_int_list()
    ans = 0
    for i in range(1, n + 1):
        start = i
        cnt = 0
        while start < k:
            start *= 2
            cnt += 1
        ans += 1 / (n * 2**cnt)
    print(ans)
    return


if __name__ == "__main__":
    main()
# Judge status: Accepted
#from math import sqrt
#from heapq import heappush, heappop
#from collections import deque

n, k = [int(v) for v in input().split()]
p = [int(v) for v in input().split()]

max_p = max(p)

dp = [0] * (max_p+1)
dp[1] = 1
for i in range(2, max_p+1):
    dp[i] = dp[i - 1] + i
    dp[i - 1] /= (i - 1)
dp[max_p] /= max_p

e = 0
for i in range(k):
    e += dp[p[i]]

max_e = e

for i in range(k, n):
    e -= dp[p[i - k]]
    e += dp[p[i]]
    max_e = max(max_e, e)

print(max_e)
# Judge status: Accepted
n, k = map(int, input().split())
a = list(map(int, input().split()))

for i in range(n):
    a[i] -= 1

l = [-1]*(n + 1)
l[0] = 0

order = 0
now = 0

while k > 0:
    k -= 1
    now = a[now]
    order += 1
    if l[now] == -1:
        l[now] = order
    else:
        loop = order - l[now]
        k %= loop
        break

while k > 0:
    k -= 1
    now = a[now]

print(now + 1)
# Judge status: Wrong Answer
R=int(input())
a=R*3.141516
print(a)
# Judge status: Accepted
n = int(input())
L = [*map(int, input().split())]
M = {}
for l in L:
    if l in M: M[l] += 1
    else: M[l] = 1
M = list(M.items())
M.sort()
m = len(M)
c = 0
for i in range(m):
    for j in range(i+1, m):
        for k in range(j+1, m):
            if M[i][0]+M[j][0] > M[k][0]:
                c += M[i][1] * M[j][1] * M[k][1]
print(c)
# Judge status: Wrong Answer
A,B=map(int,input().split())
if A and B <10:
  print(A*B)
else:
  print("-1")
# Judge status: Accepted
A=int(input())
B=int(input())
C=int(input())
X=int(input())
cnt=0
for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            if 500*i+100*j+50*k ==X:
                cnt += 1
print(cnt)
# Judge status: Accepted
N = int(input())
print( -(-N // 2))
# Judge status: Wrong Answer
k = int(input())
a, b = map(int, input().split())

a1 = a//k
b1 = b//k
if (b1>a1 and b1 != 0):
    print("OK")
elif (a == b and a%k == 0):
    print("OK")
else:
    print("NG")
# Judge status: Wrong Answer
n,m = map(int,input().split())
a = list(map(int,input().split()))
if n > sum(a):
    print(n-sum(a))
else:
    print(-1)
# Judge status: Accepted
num_list = [int(i) for i in input().split()]
K = int(input())

max_sum = max(num_list)*2**K + sum(num_list) - max(num_list)

print(max_sum)
# Judge status: Wrong Answer
import sys
sys.setrecursionlimit(10**6)
read = sys.stdin.read
readlines = sys.stdin.readlines
def main():
    n = int(input())
    a = input()

    if not 'WR' in a:
        print(0)
    else:
        rightmostW = a.find('RW')
        wnum = a[rightmostW+1:].count('R')
        leftmostR = a.rfind('R')
        wnum2 = a[:leftmostR+1].count('W')
        r = min(wnum, wnum2)
        print(r)

if __name__ == '__main__':
    main()
# Judge status: Accepted
A,B=map(int,input().split())
print('Yes' if A==B else 'No')
# Judge status: Wrong Answer
N, M, X = map(int, input().split())

INF = 30
ans = 1 << INF

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

for i in range(1, 2**N):
    tmp = 0
    skill = [0] * M
    for j in range(N):
        if i >> j & 1:
            tmp += data[j][0]
            for k in range(M):
                skill[k] += data[j][k - 1]
    if min(skill) >= X and tmp < ans:
        ans = tmp

if ans == 1 << INF:
    print('-1')
else:
    print(ans)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))

def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a%b)

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

k = a[0]
for ai in a:
    k = lcm(ai, k)

res = 0
for ai in a:
    res += k//ai

print(res % 1000000007)
# Judge status: Wrong Answer
def main():
    import sys
    from itertools import groupby
    *_, = sys.stdin.read()
    __ = _ [2::2]
    __.sort()
    ___ = 0
    ________ = 2
    for ____, _____ in groupby(__):
        ______ = tuple(_____)
        _______ = len(______)
        _______ %= ________
        ___ += _______

    print(___)


if __name__ == '__main__':
    main()
# Judge status: Accepted
n, m = map(int, input().split())
a = list(map(int, input().split()))

print(max(n - sum(a), - 1))
# Judge status: Wrong Answer
n = int(input())
a = list(map(int,input().split()))
ans = []
for i in range(n):
    if i%2==1:
        ans.insert(0,a[i])
    else:
        ans.append(a[i])
if n%2==1:
    ans.reverse()
print(ans)
# Judge status: Wrong Answer
n,m = map(int, input().split())
a = [int(input()) for i in range(m)]
step = [1] + [0]*n
for i in range(1,n+1):
    if i in a:
        continue
    else:
        if i-1 not in a:
            step[i] += step[i-1]
        if i-2 not in a and i>=2:
            step[i] += step[i-2]
        if i-1 in a and i-2 in a:
            print(0)
            break
print(step[n]%(10**9+7))
# Judge status: Accepted
#!/usr/bin/env python3
from scipy.special import comb

n, *s = open(0).read().split()
d = {}
for i in s:
    l = "".join(sorted(j for j in i))
    if l in d:
        d[l] += 1
    else:
        d[l] = 1
print(sum(comb(i, 2,exact=True) for i in d.values()))
# Judge status: Accepted
n, r = map(int, input().split())
if n >= 10:
    print(r)
else:
    print(r + 100*(10-n))
# Judge status: Wrong Answer
'x = int(input())\n\nprint(x)\n\nprint("Hello World!")'
# Judge status: Wrong Answer
a, b, c = map(int, input().split())

if a+b*2 >= c:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
n = int(input())
ans = 0
for i in range(1,n+1):
  num = str(i)
  if (len(num) % 2) != 0:
    ans += 1
print(ans)
# Judge status: Accepted
n=int(input())
l=list(map(int,input().split()))
dp=[0]*n
dp[0]=0
dp[1]=abs(l[1]-l[0])
for i in range(2,n):
	dp[i]=min(dp[i-1]+abs(l[i-1]-l[i]),dp[i-2]+abs(l[i-2]-l[i]))
print(dp[-1])
# Judge status: Accepted
l,r = map(int,input().split())
sub = r-l
l %= 2019
r %= 2019

if(sub >= 2019):
    print(0)
    exit()

mina = float('INF')

for x in range(l,r+1):
    for y in range(x,r+1):
        if(x==y):
            continue
        
        ans = (x * y) % 2019
        if(mina > ans):
            mina = ans
       
print(mina)
# Judge status: Accepted
N, M, K = map(int,input().split())

for k in range(N+1):
    for l in range(M+1):
        if k*l + (M-l)*(N-k) == K:
            print("Yes")
            exit(0)
print("No")
# Judge status: Accepted
import math
n,a,b,c,d,e = map(int,open(0).read().split())

print(5+math.ceil(n/min([a,b,c,d,e]))-1)
# Judge status: Wrong Answer
##B
N = int(input())
S = list(input() for i in range(N))
a=0
b=0
c=0
d=0
for i in S:
    if i =="AC":
        a +=1
    elif i =="WA":
        b +=1
    elif i =="TLE":
        c +=1
    elif i =="RE":
        d +=1
print("AC × "+ str(a))
print("WA × "+ str(b))
print("TLE × "+ str(c))
print("RE × "+ str(d))
# Judge status: Wrong Answer
syl=sorted(list(map(int,input().split())))

print(syl)

syl2=[5, 5, 7]

if syl == syl2:
	print('YES')
else:
	print('NO')
# Judge status: Accepted
N,K = map(int, input().split())
A = [*map(lambda x:int(x)-1, input().split())]
index = [-1]*N
path = []
pre = 0
while index[pre] < 0:
    index[pre] = len(path)
    path += [pre]
    pre = A[pre]
one = index[pre]
loops = len(path) - one
if K < one: print(path[K]+1)
else: print(path[(K-one) % loops + one]+1)
# Judge status: Wrong Answer
def main():
    X = int(input())
    for i in range(1, 100000):
        if X == i:
            print(i)
            break
        elif X - i <= i + 1:
            pass
        else:
            X -= i
            
if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
A,B = map(int,input().split())
count = 0
for i in range(A,B+1):
  i = str(i)
  num = 1
  if len(i)%2 == 0:
    num = 0
  if i[:len(i)//2] == i[len(i)//2+num:]:
    count += 1
print(count)
# Judge status: Accepted
w = input()
w_set = set(w)
d = {}
for i in w_set:
    d[i] = 0
for i in w:
    d[i] += 1

for i in d.values():
    if i % 2 != 0:
        print("No")
        exit()
print("Yes")
# Judge status: Accepted
x,a,b = map(int, input().split())

if b <= a:
    print('delicious')
elif b-a <= x:
    print('safe') 
else:
    print('dangerous')
# Judge status: Wrong Answer
import sys

def solve():
    input = sys.stdin.readline
    S = input().strip("\n")
    z, o = 0, 0
    for i in range(len(S)):
        if S[i] == "0": z += 1
        else: o += 1
        print(2 * min(z, o))
    return 0

if __name__ == "__main__":
    solve()
# Judge status: Wrong Answer
n, x = map(int,input().split())
l = list(map(int,input().split()))

a = 0
for i in range(n):
    a = a + l[i]
    #print(a)
    if x == a:
        print(i+1+1)
        break
    elif x <= a:
        print(i+1)
        break
    else:
        continue
# Judge status: Accepted
N = int(input())
S = input()

R_count = S.count("R")
B_count = S.count("B")
G_count = S.count("G")

distance_1To2 = 0
t = 0
for i in range(N-2):
    for j in range(i+1,N):
        if j+(j-i) >= N:
            break
        if S[j] != S[i]:
            if S[j] != S[j+(j-i)] and S[i] != S[j+(j-i)]:
                t += 1

print((R_count*B_count*G_count) - t)
# Judge status: Wrong Answer
n = int(input())
s = list(input())
print(s)
ans = 0
for i in range(1, n-1):
    x = set(s[:i])
    y = set(s[i:])
    cnt = 0
    for c in x:
        if c in y:
            cnt += 1
    if cnt > ans:
        ans = cnt

print(ans)
# Judge status: Wrong Answer
print('YNeos'[input()not in'357'::2])
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
a.sort()
maxkouho = a[-1]
k = maxkouho/2
maxans = 10**18
ans = 0
for i in range(n-1):
	s = abs(a[i]-k)
	if s < maxans:
		maxans = s
		ans = a[i]
print(maxkouho, ans)
# Judge status: Accepted
import sys
def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
from functools import partial, reduce
from collections import Counter


def f_chain(*args):
    return reduce(lambda x, f: f(x), args)

def main():
    n = II()
    aa = [II() for _ in range(n)]
    c_cnt = Counter(aa).values()
    f_chain(c_cnt,
            partial(map, lambda x: 1 if x%2==1 else 0),
            sum,
            print)

if __name__ == '__main__':
    main()
# Judge status: Accepted
n = int(input())

temp = n
p = 2
res = 0
while p * p <= n:
    if temp % p == 0:
        cnt = 1
        while temp % (p ** (cnt + 1)) == 0:
            cnt += 1
        res += int((-1 + (1 + 8 * cnt) ** 0.5) // 2)
        temp //= p ** cnt
    p += 1

print(res + (temp != 1))