peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
import sys

input = sys.stdin.readline


def main():
    N, K = map(int, input().split())
    S = input().rstrip()

    n_LR_change = 0
    for i in range(N - 1):
        if S[i] != S[i + 1]:
            n_LR_change += 1

    ans = min(N - 1, (N - 1) - n_LR_change + 2 * K)
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
import math

def prime_factorize(n):
    num_list = []
    m = n
    for i in range(2,int(math.sqrt(n)) + 1):
        if m % i == 0 and i not in num_list:
            num_list.append(i)
            m //= i
    return (num_list)

N = int(input())
print(len(prime_factorize(N)))
# Judge status: Accepted
n=int(input())
s=input()
t=input()
match = 0

for i in range(n):
    if s[i:] == t[:n-i]:
        match = n-i
        break

print(2*n-match)
# Judge status: Accepted
a, b = map(str, input().split())

c = int(a + b)
if ((c ** 0.5).is_integer()):
   print('Yes')
else:
   print('No')
# Judge status: Accepted
N = int(input())
L = list(map(int, input().split()))
L.sort()
print('Yes' if L[-1]<sum(L)-L[-1] else 'No')
# Judge status: Accepted
a,b,c = map(int, input().split())
print('Yes') if 4*a*b < (c - a -b)**2 and a+b < c else print('No')
# Judge status: Wrong Answer
N = int(input())
s = [int(input()) for i in range(N)]

def calc_gcd(a,b):
  if a < b:
    a, b = b, a
  while a % b != 0:
    a, b = b, a % b
  return (b)

ans = s[0]
for i in range(1,N):
  gcd_tmp = calc_gcd(ans,s[i]) 
  ans = ans * s[i] / gcd_tmp
print(int(ans))
# Judge status: Accepted
n=int(input())
*a,=map(int,input().split())
b=[x**2 for x in a]

mod=10**9+7
print(((sum(a)**2-sum(b))//2)%mod)
# Judge status: Wrong Answer
n = int(input())
a = [0]*n
for i in range(n):
    a[i] = int(input())
s = n
a.sort()
for i in range(n-1):
    if(a[i] == a[i+1]):
        s -= 2
print(s)
# Judge status: Accepted
N = int(input())
ans =  10**N -( 9**N + 9**N - 8**N ) 
print( ans%( 10**9 + 7) )
# Judge status: Accepted
num_str = input()

mod = 0

for n in num_str:
  mod += int(n)
  mod %= 9

if mod % 9 == 0:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
N = int(input())
Mgr = [int(num) for num in input().split()]
sub = [0]*N

for i in range(len(Mgr)):
    sub[Mgr[i]-1] += 1

for i in range(N):
    print(sub[i])
# Judge status: Accepted
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]


n = int(input())

ans = 0
for i in range(1,n+1):
    ans += i
print(ans)
# Judge status: Accepted
N,M=map(int,input().split())
sc = [list(map(int,input().split())) for _ in range(M)]

if N>1:
    s = list('1'+'0'*(N-1))
else:
    s=list('0')
d = {1:-1,2:-1,3:-1}
sw = 0
for i in range(M):
    s[sc[i][0]-1] = str(sc[i][1])
    if d[sc[i][0]]==-1: 
        d[sc[i][0]] = sc[i][1]
    elif d[sc[i][0]]!=sc[i][1]:
        sw=1
if sw==1:
    print(-1)
elif s[0]=='0' and N>1:
    print(-1)
else:
    print(''.join(s))
# Judge status: Accepted
S = input()
if (("N" in S) ^ ("S" in S)) or (("E" in S) ^ ("W" in S)): print("No")
else: print("Yes")
# Judge status: Accepted
n=int(input())
a=[0]*n
a=map(int,input().split())
    
z=0
result=0
min=1000000002

for i in a:
    if i<0:
        z+=1
    result+=abs(i)
    if abs(i)<min:
        min=abs(i)

if z%2==1:
    result-=min*2

print(result)
# Judge status: Accepted
X, Y = map(int, input().split())

ans = 1
while True:
    X *= 2
    if X <= Y:
        ans += 1
    else:
        break
print(ans)
# Judge status: Accepted
x=input()
x0=x.split()
a1=int(x0[0])
a2=int(x0[1])
a3=int(x0[2])
a4=int(x0[3])
a5=int(x0[4])
if a1==0:
    print(1)
if a2==0:
    print(2)
if a3==0:
    print(3)
if a4==0:
    print(4)
if a5==0:
    print(5)
# Judge status: Accepted
s=input()
n=len(s)
i=1
for j in range(n):
    if s[-i:-i-5:-1]=="maerd":
        i+=5
 
    if s[-i:-i-5:-1]=="esare":
        i+=5

    if s[-i:-i-6:-1]=="resare":
        i+=6

    if s[-i:-i-7:-1]=="remaerd":
        i+=7

    if i==n+1:
        print("YES")
        break

if i != n+1:
    print("NO")
# Judge status: Wrong Answer
n, c, k = map(int, input().split())
t = [int(input()) for i in range(n)]
t.sort()
cur = t[0]
ans = 1
cnt = 0
for i in t:
    if i > cur + k or cnt >= c:
        ans += 1
        cnt = 0
        cur = i
    else:
        cnt += 1
print(ans)
# Judge status: Accepted
s = input()
t = input()
ans = 0
for ss,tt in zip(s,t ):
  if ss != tt:
    ans += 1
print(ans)
# Judge status: Accepted
import sys
from itertools import combinations as combi
input = sys.stdin.readline
N, M = map(int, input().split())
if N == 1:
  print(M)
  exit(0)
i = 2
res = 1
while i * i <= M:
  t = 1
  if M % i == 0 and (M // i >= N):
    res = max(res, i)
    t = M // i
  if M % t == 0 and (M // t >= N):
    res = max(res, t)
  i += 1
print(res)
# Judge status: Wrong Answer
X, N = map(int, input().split())
#X = 100
#N = 0

p = list(map(int, input().split()))
#p = [4,7,10,6,5]
if N == 0:
    print(X)
    exit()

p.sort()
all = [i for i in range(1,101)]
for i in p:
    if i in all:
        all.remove(i)
if len(all) == 0:
    exit()
min = 101
min_k = 0
for k,i in enumerate(all):
    tmp = abs(X-i)
    if min > tmp:
        min = tmp
        min_k =k
print(all[min_k])
# Judge status: Accepted

N = int(input())

alp = "abcdefghijklmnopqrstuvwxyz"

ans =  [ ["",0] ]


for i in range(N):

    nex = []

    for s,i in ans:

        for j in range(i+1):

            nex.append([s+alp[j] , max(i,j+1)])

    ans = nex
    #print (ans)

ans.sort()

for s,i in ans:
    print (s)
# Judge status: Wrong Answer
h=int(input())
w=int(input())
n=int(input())
if h>=w:
    print((n//h)+1)
else:
    print((n//w)+1)
# Judge status: Accepted
n=int(input())
a=list(map(int, input().split()))
a.sort()
print(sum(a[n::2]))
# Judge status: Accepted
A = int(input())
B = int(input())
C = int(input())
X = int(input())
count = 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:
                count+=1
print(count)
# Judge status: Wrong Answer
n,m = map(int,input().split())
if n == 1 or m == 1:
    print(n*m-2)
else:
    print((n-2)*(m-2))
# Judge status: Accepted
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') 
inf = float('inf') ;mod = 10**9+7 
mans = inf ;ans = 0 ;count = 0 ;pro = 1

n = input()
for i in range(len(n)):
    count += int(n[i])
if count%9 == 0:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n, k = map(int, input().split())

while True:
	buff = n-k
	if buff <= 0:
		if buff < n:
			print(n)
		else:
			print(abs(buff))
		break
	n = buff
# Judge status: Accepted
x = int(input())

Q = (x-1)//11
M = (x-1)%11 

if M <= 5:
  print(2*Q+1)
else:
  print(2*Q+2)
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-


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


def check2(s):
    l = len(s) // 2
    if s[:l] != s[:l:-1]:
        return False
    return True


def check(s):
    l = len(s) // 2
    if s[:l] != s[:l:-1]:
        return False
    if check2(s[:l]) and check2(s[l+1:]):
        return  True
    return False


def main():
    s = input()
    if check(s):
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()
# Judge status: Accepted
from itertools import permutations
N = int(input())
P = tuple(int(x) for x in input().split())
Q = tuple(int(x) for x in input().split())
L = list(range(1,N+1))
R = list(permutations(L))
print(abs(R.index(P)-R.index(Q)))
# Judge status: Accepted
n = int(input())
p = list(map(int, input().split()))
ans = 0
for i in range(1,n-1):
    if p[i-1] < p[i] < p[i+1] or p[i-1] > p[i] > p[i+1]:
        ans += 1

print(ans)
# Judge status: Wrong Answer
N, X = map(int,input().split())
lst = list(map(int,input().split()))

cnt = 0
now = 0
for i in range(N):
    l = now + lst[i]
    cnt += 1
    if now > X:
        break
print(cnt)
# Judge status: Accepted
x = int(input())

def prime(n):
  a = int(n**(1/2))
  for i in range(2,a+1):
    if n%i==0: return False
  return True

while (1):
  if prime(x)==False: x += 1
  else: break
print(x)
# Judge status: Accepted
s = list(map(int, input().split()))
N = s[0]
A = s[1]
B = s[2]

if (B - A) % 2 == 0:
  print((B - A) // 2)
else:
  print(min(A - 1,N - B) +  1 + (B - A - 1) // 2)
# Judge status: Wrong Answer
K,X=map(int,input().split())
for x in range(X-K+1,X+K-1):
  print(x)
# Judge status: Accepted
s=input()
n=len(s)//2
print('Yes'if s[:n]==s[n-1::-1]==s[-n:]else'No')
# Judge status: Accepted
def main():
  N = int(input())
  A = [int(_) for _ in input().split()]
  ret = 10 ** 10
  for tar in range(-100, 101):
    cc = 0
    for a in A:
      cc += (tar - a) ** 2
    ret = min(ret, cc)
  print(ret)
  return

if __name__ == '__main__':
  main()
# Judge status: Wrong Answer
s = list(map(str,input()))
t = list(map(str,input()))

s = set(s)
t = set(t)

if len(s) == len(t):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n = ii()
H = iil()
mh = 0
for i in H:
    if mh - 1 > i:
        print('No')
        exit()
    else:
        mh = max(mh,i)
print('Yes')
# Judge status: Accepted
p,q,r=map(int,input().split())
print(min(p+q,q+r,p+r))
# Judge status: Wrong Answer
N = int(input())
if N % 2 ==0:
  print(N/2)

else:
  print((N/2)+1)
# Judge status: Wrong Answer
n,m,k = map(int, input().split())

# 行と列の組み合わせを全探索で試し、1回でも成立する場合は終了する
for i in range(n):
  for j in range(m):
    if i*(m-j) + j*(n-i) == k:
      print("Yes")
      exit()
print("No")
# Judge status: Accepted
N=int(input())
A=sorted(list(map(int,input().split())))
n,r=A.pop(),0
index=0
for i,j in enumerate(A):
    num=min(n-j,j)
    if num>r:
        index=i
        r=num
print(n,A[index])
# Judge status: Accepted
from operator import itemgetter
N, M = map(int, input().split())
AB = sorted([list(map(int, input().split())) for i in range(N)], key=itemgetter(0))
ans, tmp = 0, 0
for ab in AB:
    if ab[1] + tmp < M:
        tmp += ab[1]
        ans += ab[0] * ab[1]
    else:
        ans += (M - tmp) * ab[0]
        break
print(ans)
# Judge status: Accepted
icase=0
if icase==0:
    a,b=map(int,input().split())
    x=max(a,b)
    y=max(min(a,b),x-1)
    print(x+y)
# Judge status: Accepted
n = int(input())
if n%2 == 0:
  print(0.5)
else:
  print((n//2+1)/n)
# Judge status: Wrong Answer
N = int(input())
A = [input() for _ in range(N)]
import collections
c = collections.Counter(A)
a = 0
for i in c.values():
  if i%2 == 0:
    continue
  else:
    a = a+1
    
print(a)
print(c.values())
# Judge status: Accepted
S,W = map(int, input().split())
if S <= W:
    print("unsafe")
else:print("safe")
# Judge status: Wrong Answer
M = 1000000007

N, K = map(int, input().split())
A = list(map(int, input().split()))
prefix = [1] * (N + 1)
for i, a in enumerate(A, 1):
    prefix[i] = prefix[i - 1] * a
    prefix[i] %= M

prev = prefix[K]
for i in range(K + 1, N + 1):
    cur = (prefix[i] * pow(prefix[i - K], -1, M)) % M
    if cur > prev:
        print('Yes')
    else:
        print('No')
    prev = cur
# Judge status: Accepted
N, M = map(int, input().split())
dp = [0] * N
for _ in range(M):
    a = int(input())
    dp[a-1] = -1

k = 1000000007


for i in range(N):
    if dp[i] == -1:
        dp[i] = 0
        continue
    if i == 0:
        dp[i] = 1
        continue
    if i == 1:
        dp[i] = dp[i-1] + 1
        continue

    dp[i] = dp[i-1] + dp[i-2]
    dp[i] %= k



print(dp[-1])
# Judge status: Accepted
# A - Good Integer
#  標準入力N

N = input()
my_list = []
j = 0

for i in N:
    my_list.append(i)

if my_list[0] == my_list[1] == my_list[2] or my_list[1] == my_list[2] == my_list[3]:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
s = list(map(int,list(input())))

s = s[::-1]
s = s + [0]
cnt = 0
kuri = 0

for i in range(len(s)):
  n = s[i]
  if n < 5:
    cnt += n
  elif n > 5:
    cnt += 10 - n
    s[i+1] += 1
  else:
    if s[i+1] >= 5:
      s[i+1] += 1
    cnt += 10 - n
print(cnt)
# Judge status: Wrong Answer
n, m = map(int,input().split())
for i in range(m):
    temp = (i + 1, n - i)
    print(*temp)
# Judge status: Accepted
m, n = [int(i) for i in input().strip().split()]
string = input().strip()
print(string[:n - 1] + string[n - 1: n].lower() + string[n:])
# Judge status: Accepted
N, M = map(int, input().split())
if 2*N <= M:
    ans = N
    M -= 2*N
    ans += M//4
else:
    ans = M//2
print(ans)
# Judge status: Accepted
(n, m, x, y) = map(int, input().split())
rightx = max(map(int, input().split()))
lefty = min(map(int, input().split()))

if rightx < min(y, lefty) and x < lefty:
  print('No War')
else:
  print('War')
# Judge status: Wrong Answer
M,N = list(map(int,input().split()))
s = list(map(int,input().split()))
count = 0
kiroku = 0

for i in range(M-N):
    if sum(s[i:i+N]) > count:
        count = sum(s[i:i+N])
        kiroku = i


b = 0
for i in range(kiroku,kiroku+N):
    a = (1+s[i])/2
    b += a
    
print(b)
# Judge status: Accepted
N = int(input())
X = list(map(int,input().split()))
p = round(sum(X)/len(X))
print(sum([(x-p)**2 for x in X]))
# Judge status: Wrong Answer
n=int(input())
for i in range(0,n):
    if n==1 or n==2:
        print(n)
        break
    if n>=i*i:
        pass
    else:
        print((i-1)*(i-1))
        break
# Judge status: Accepted
import bisect
 
n = int(input())
as_ = list(map(int, input().split()))
bs_ = list(map(int, input().split()))
cs_ = list(map(int, input().split()))
 
as_.sort()
bs_.sort()
cs_.sort()
 
ans = 0
for b in bs_:
  ans += bisect.bisect_left(as_, b) * (n-bisect.bisect_right(cs_, b))
print(ans)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))

cnt = 0
num = 1
for i in range(n):
  if a[i] == num :
    num += 1
    continue
  cnt += 1

print(cnt if num > 1 else -1)
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
if a+b+c<22:
    print('bust')
else: 
    print('win')
# Judge status: Accepted
N = list(str(input()))
if int(N[0]) == 7 or int(N[1]) == 7 or int(N[2]) == 7:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
S = input()
cand = ['hi','hihi','hihihi','hihihihi','hihihihihi']
if S in cand:
    ans = 'Yes'
else:
    ans = 'No'
print(ans)
# Judge status: Wrong Answer
n = input().split(" ")
print(n)

a = n[0]
b = n[1]
c = n[2]

"aとbの入れ替え"
n[0] = b
n[1] = a
"aとcの入れ替え"
n[0] = c
n[2] = b

print(n[0]+" "+n[1]+" "+n[2]+" ")
# Judge status: Wrong Answer
N = int(input())
for i in range(N):
    if(i * i > N):
        print((i -1) * (i - 1))
        break
# Judge status: Accepted
N,K = map(int, input().split())
S = list(input())

ans = 0

for i in range(1,N):
    if S[i-1]==S[i]:
        ans += 1

if ans + 2*K <= N-1:
    print(ans + 2*K)
else:
    print(N-1)
# Judge status: Wrong Answer
n=int(input())
li=list(map(int,input().split()))
a=0
for i in range(len(li)):
    if i %2!=0:
        if li[i]%2!=0:
            a+=1
print(a)
# Judge status: Accepted
def main():
    n,m=map(int,input().split())
    ans=1
    mod=10**9+7
    if abs(n-m)>=2:
        print(0)
    elif n==m:
        for i in range(1,n+1):
            ans=(ans*i**2)%mod
        ans=(2*ans)%mod
        print(ans)
    else:
        for i in range(1,min(m,n)+1):
            ans=(ans*i**2)%mod
        ans=(ans*max(m,n))%mod
        print(ans)
if __name__=="__main__":
    main()
# Judge status: Wrong Answer
N, X, T = map(int, input().split())

if N <= X:
    print(T)
else:
    a = N // X
    b = a * T
    c = b + (int(N / X ) - a +T)
    print(c)
# Judge status: Accepted
S = input()
T = input()
res = 'No'
for i in range(len(S)):
    if S[i:] + S[:i] == T:
        res = 'Yes'
        break
print(res)
# Judge status: Accepted
n = int(input())
s = input()
ans = s.count('R')*s.count('B')*s.count('G')
for i in range(n-2):
    for j in range(i+1,n-1):
        k = j + (j - i)
        if k>=n:break
        if s[i] != s[j] and s[i] != s[k] and s[j] != s[k]:
            ans -= 1
        
print(ans)
# Judge status: Wrong Answer
A,B = map(int,input().split())

if A + B <= 24:
	answer= A + B
elif A + B > 24:
	answer = (A + B) - 24
print(answer)
# Judge status: Accepted
N=int(input())-1
L=[]
S=[]
A=[chr(i) for i in range(97,123)]
X=""
while N>=0:
  if N==0:
    L.append(N%26)
    N=N//26
    break
  elif N!=0:
    L.append(N%26)
    N=N//26-1
S=list(reversed(L))
for i in range(len(S)):
  X+=A[S[i]]
print(str(X))
# Judge status: Accepted
def solve(n, T):

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

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

    l = T.pop()
    for t in T:
        l = lcm(l, t)
    return l

_n = int(input())
_T = [int(input()) for _ in range(_n)]
print(solve(_n, _T))
# Judge status: Accepted
def ansstr(s,n,c):
    if len(s)==n:
        print(s)
    else:
        for i in range(c+1):
            a=0
            ch=chr(ord('a')+i)
            if i==c:
                a=1
            ansstr(s+ch,n,c+a)
    
    
n=int(input())
ansstr("a",n,1)
# Judge status: Accepted
s = input()

if s.islower():
    print('a')
else:
    print('A')
# Judge status: Accepted
def main():
    import sys
    input = sys.stdin.readline

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

    ans = 0
    all_num = sum(A)
    for i in range(N, 1, -1):
        all_num -= A[i - 1]
        ans += A[i - 1] * all_num
    print(ans % (10 ** 9 + 7))


main()
# Judge status: Wrong Answer
l, r = map(int, input().split())

if (l-1)//2019 != r//2019:
	print(0)
else:
	print(((l%2019)*((l+1)%2019))%2019)
# Judge status: Accepted
a,b,c=map(int,input().split())
print('Yes' if a+b>=c else 'No')
# Judge status: Wrong Answer
A, B, N = map(int, input().split())

print(min(B-1, N))
# Judge status: Accepted
A, B = map(int, input().split())
if A + B >= 24:
    print((A + B) - 24)
else:
    print(A + B)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
ans1 = list(range(1, n+1, 2))
ans2 = list(range(2, n+1, 2))
if n % 2 == 0:
    ans2.reverse()
    ans = ans2 + ans1
else:
    ans1.reverse()
    ans = ans1 + ans2
for i in ans:
    print(a[i-1])
# Judge status: Wrong Answer
abc = list(map(int, input().split()))
abc.sort()
print(abc[0]*abc[1]/2)
# Judge status: Accepted
import collections
def solve(n, k, a_list):

    counter = collections.Counter()

    for i in a_list:
        counter[i] += 1

    tmp = sorted(counter.values(), reverse=True)
    ans = n - sum(tmp[:k])
    
    return ans

if __name__ == "__main__":
    n, k = [int(i) for i in input().split()]
    a_list = [int(i) for i in input().split()]
    print(solve(n, k, a_list))
# Judge status: Accepted
from fractions import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import product, combinations,permutations
from copy import deepcopy
import sys
sys.setrecursionlimit(4100000)



if __name__ == '__main__':
    N, K = map(int, input().split())
    cnt = 0
    while N!=0:
        N //= K
        cnt += 1
    print(cnt)
# Judge status: Accepted
N=int(input())
A=list(set(list(map(int,input().split()))))

if min(A)==1:
  print(1)
  exit()

while len(A)>1:
  monster_min = A.pop(A.index(min(A)))
  for i in range(len(A)):
    A[i] %= monster_min
  A.sort()
  for i in A[:]:  
    if i == 0: A.remove(i)
    else: continue
  A.append(monster_min)

print(A[0])
# Judge status: Wrong Answer
PI = 3.14159265
def circumference(r):
    return (2 * PI * r)
# Judge status: Wrong Answer
cnt = 0
t = list(input())
for i in range(len(t)):
    if "R" * i in t:
        cnt = i + 1
print(cnt)
# Judge status: Accepted
N, M = map(int,input().split())
a = int((N * (N-1) + M * (M-1)) / 2)
print(a)
# Judge status: Accepted
s,c = map(int,input().split())

a = c //2
if s >= a:
    ans = a
else:
    b = c - 2 * s
    ans = s + b//4
print(ans)
# Judge status: Accepted
def main2():
    N, M, K = map(int, input().split())

    for i in range(N + 1):
        for j in range(M + 1):
            b = i * (M - j) + j * (N - i)

            if b == K:
                print("Yes")
                exit()

    print("No")

if __name__ == "__main__":
    main2()
# Judge status: Accepted
import sys
#input = sys.stdin.buffer.readline
N = int(input())
temp = 5
ans = 0
if N%2:
    print(0)
    quit()
else:
    N = N//2
    while temp <= N:
        ans += N//temp
        temp *= 5
print(ans)
# Judge status: Accepted
s = input()

if s[2] == s[3] and s[4] == s[5]:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
nums = list(map(int,input().split()))
poor = False
for n in nums:
  if nums.count(n) == 2:
    poor = True
print("Yes" if poor else "No")
# Judge status: Accepted
from itertools import combinations_with_replacement

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

query = []
num_list = list(range(m))

for _ in range(q):
    array = list(map(int, input().split()))
    query.append(array)

max_score = 0

for i in combinations_with_replacement(num_list, n):
    score = 0
    for a,b,c,d in query:
        if i[b-1] - i[a-1] == c:
            score += d
    if max_score < score:
        max_score = score

print(max_score)
# Judge status: Accepted
n,k = map(int,input().split())
a = list(map(int,input().split()))
 
t = 1
tl = [1]
ts = {1}
for i in range(len(a)):
 
    t = a[t-1]
    if t in ts:
        break
    else:
        tl.append(t)
        ts.add(t)
 
tl2 = tl[tl.index(t):len(tl)]
 
 
if k < len(tl):
    ans = tl[k]
else:
    k = k - (len(tl) - len(tl2))
    j = k % len(tl2)
    ans = tl2[j]
 
print(ans)
# Judge status: Accepted
N = int(input())
p = 10**9+7
a = 1
b = 1
c = 1
for _ in range(N):
  a = a*10%p
  b = b*9%p
  c = c*8%p
n = (a-2*b+c)%p
print(n)
# Judge status: Accepted
N, K = map(int, input().split())

if N > K:
    if N % K > K / 2:
        print(K - (N % K))
    else:
        print(N % K)
else:
    if N > K / 2:
        print(K - N)
    else:
        print(N)
# Judge status: Accepted
S = int(input())

y = (S+10**9-1)//10**9
x = y*(10**9)-S

print(0,0,10**9,1,x,y)
# Judge status: Accepted
# Python3 (3.4.3)
import sys
input = sys.stdin.readline

# -------------------------------------------------------------
# function
# -------------------------------------------------------------
def gcd(a,b):
    return a if b == 0 else gcd(b,a%b)

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

ans = A[0]
for i in range(1,N):
    ans = gcd(ans,A[i])
 
print(ans)
# Judge status: Accepted
import sys
x = int(input())

a = 0
while a < 1000:
  b = -1000
  while b < 1000:
    if a ** 5 - b ** 5 == x:
      print(a, b)
      sys.exit()
    b += 1
  a += 1
# Judge status: Accepted
S=input()
T=input()
c=0
for x,y in zip(S,T):
    if x != y:
        c+=1
print(c)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
b = 1000
for i in range(n-1):
    if a[i] < a[i+1]:
        b += b//a[i]*(a[i+1]-a[i])
print(b)
# Judge status: Accepted
S, c = map(int, input().split())
if S*2 > c:
    ans = c//2
else:
    ans = S
    c -= S*2
    ans += c//4
print(ans)
# Judge status: Accepted
S = input()

L = []
for i in range(len(S)):
    L.append(S[i])

B = False
for i, v in enumerate(L):
    L.pop(i)
    if (v in L):
        B = True
        break
    else:
        L.insert(i, v)

if B:
    print('no')
else:
    print('yes')
# Judge status: Wrong Answer
W, H, x, y = map(int, input().split())

max_area = W * H / 2
print("{} {}".format(max_area, 1 if x / W == y / H else 0))
# Judge status: Accepted
n = int(input())
h = [0] + list(map(int, input().split()))

dp = [0] * (n + 1)
dp[1] = 0
dp[2] = dp[1] + abs(h[2] - h[1])

for i in range(3, n + 1):
	dp[i] = min(dp[i - 2] + abs(h[i] - h[i - 2]),
				dp[i - 1] + abs(h[i] - h[i - 1]))

print(dp[n])
# Judge status: Wrong Answer
a = int(input())
if a >= 1800:
  print('1')
elif a >=1600:
  print('2')
elif a >=1400:
  print('3')
elif a>=1200:
  print('4')
elif a >= 1000:
  print('5')
elif a >=800:
  print('6')
else:
  print('7')