Harryxun/stf_run huggingface dataset:
N, M = map(int, input().split())
A = [0] * M
B = [0] * M
for i in range(M):
    A[i], B[i] = map(int, input().split())

class UnionFind:
    def __init__(self, n):
        # 親要素のノード番号を格納。par[x] == xの時そのノードは根
        self.par = [-1 for i in range(n + 1)]
        # 木の高さを格納する（初期状態では0）
        """self.rank = [0] * (n + 1)"""

    # 検索
    # 根ならその番号を返す
    def find(self, x):
        if self.par[x] < 0:
            return x
        else:
            # 走査していく過程で親を書き換える
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    # 併合
    def union(self, x, y):
        # 根を探す
        x = self.find(x)
        y = self.find(y)
        # 木の高さを比較し、低いほうから高いほうに辺を張る
        if x != y:
            if self.par[x] < self.par[y]:  # par<0の小さい方に合わせる
                self.par[y] += self.par[x]
                self.par[x] = y
            else:
                self.par[x] += self.par[y]
                self.par[y] = x
                # 木の高さが同じなら片方を1増やす
                """if self.rank[x] == self.rank[y]:
                    self.rank[x] += 1"""

    # 同じ集合に属するか判定
    def same_check(self, x, y):
        return self.find(x) == self.find(y)

    def size(self, x):
        return -self.par[self.find(x)]
    
    
u = UnionFind(N)
for i in range(M):
    u.union(A[i], B[i])
    
ans = 1
for i in range(1, N+1):
    ans = max(ans, u.size(i))
print(ans)

### FIXED CODE ###

N, M = map(int, input().split())
A = [0] * M
B = [0] * M
for i in range(M):
    A[i], B[i] = map(int, input().split())

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * (n+1)

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]
    
u = UnionFind(N)
for i in range(M):
    u.union(A[i], B[i])
    
ans = 1
for i in range(1, N+1):
    ans = max(ans, u.size(i))
print(ans)
s=int(input())
ans = 0
if s[0]==o:
  ans += 1

if s[1]==o:
  ans += 1

if s[2]==o:
  ans += 1

print(700+100*ans)

### FIXED CODE ###

s = input()
ans = 0
if s[0]=="o":
  ans += 1

if s[1]=="o":
  ans += 1

if s[2]=="o":
  ans += 1

print(700+100*ans)
import sys
import math
def get_array(): return list(map(int,sys.stdin.readline().strip().split()))
def get_ints(): return map(int,sys.stdin.readline().strip().split())
def input(): return sys.stdin.readline().strip()
x,n=get_ints()
p=get_array()
for j in range(x,0,-1):
    if j not in p:
        ans1=j 
        break
        
for k in range(x,102):
    if k not in p:
        ans2=k 
        break
if ans2-x<x-ans1:
    print(ans2)
elif x-ans1<ans2-x:
    print(ans1)
else:
    print(ans1)
            
            

    

### FIXED CODE ###

import sys
import math
def get_array(): return list(map(int,sys.stdin.readline().strip().split()))
def get_ints(): return map(int,sys.stdin.readline().strip().split())
def input(): return sys.stdin.readline().strip()
x,n=get_ints()
p=get_array()
ans1=x 
ans2=x
for j in range(x,-100,-1):
    if j not in p:
        ans1=j 
        break
for k in range(x,200):
    if k not in p:
        ans2=k 
        break
if ans2-x<x-ans1:
    print(ans2)
elif x-ans1<ans2-x:
    print(ans1)
else:
    print(ans1)
i=int(input())
l=[]
c=True
for k in range(1,i+1):
  l.append(list(input())
if len(l)==len(set(l)):
  for k in range(0,i):
    if l[k][-1]!=l[k+1][0]:
       c=False
       break
else:
  c=False
if c==False:
  print("No")
else:
  print("Yes")
           
  


### FIXED CODE ###

n=int(input())
b=True
l=[]
w=input()
l.append(w)
for i in range(n-1):
  w=input()
  if w in l or w[0]!=l[-1][-1]:
    b=False
    break
  else:
    l.append(w)
if b:
  print("Yes")
else:
  print("No")
class Solution:
    def solve(self, n: int) -> int:

        maxDivisor = int(math.sqrt(n) + 0.5)

        for i in range(1, maxDivisor + 1):
            if n % i == 0:
                p = i

        q = n // p

        return p+q-2


if __name__ == '__main__':

    # standard input
    n = int(input())

    # solve
    solution = Solution()
    print(solution.solve(n))


### FIXED CODE ###

import math


class Solution:
    def solve(self, n: int) -> int:

        maxDivisor = int(math.sqrt(n) + 0.5)

        for i in range(1, maxDivisor + 1):
            if n % i == 0:
                p = i

        q = n // p

        return p+q-2


if __name__ == '__main__':

    # standard input
    n = int(input())

    # solve
    solution = Solution()
    print(solution.solve(n))
S=str(input())
N=int(700)
if S[0]=='o'
  N=N+100
if S[1]=='o'
  N=N+100
if S[2]=='o'
  N=N+100
print(N)

### FIXED CODE ###

S=str(input())
N=int(700)
if S[0]=='o':
  N=N+100
if S[1]=='o':
  N=N+100
if S[2]=='o':
  N=N+100
print(N)
import sys
K = int(input())
A, B = [int(x) for x in input().split()]
for i in range(A, B+1):
  if i%k == 0:
    print("OK")
    sys.exit()
print("NG")

### FIXED CODE ###

import sys
K = int(input())
A, B = [int(x) for x in input().split()]
for i in range(A, B+1):
  if i%K == 0:
    print("OK")
    sys.exit()
print("NG")
import itertools
N, K = list(map(int, input().split()))
d = []
A = [[0]]*N
for i in range(K):
    d.append(int(input()))
    A[i] = list(map(int, input().split()))
 
s = list(set((list(itertools.chain.from_iterable(A)))))

for i in range(len(s)):
    if s[i] == 0:
        s.remove(0)
        break

print(N-len(s)) 

### FIXED CODE ###

import itertools
N, K = list(map(int, input().split()))
d = []
A = []
for i in range(K):
    d.append(int(input()))
    A.append(list(map(int, input().split())))
#print(A) 
s = list(set((list(itertools.chain.from_iterable(A)))))
print(N - len(s))
A, B, C, D = map(int, raw_input().split())
if A + B + C + D == 7:
  print('{}+{}+{}+{}=7'.format(A, B, C, D))
elif A + B + C - D == 7:
  print('{}+{}+{}-{}=7'.format(A, B, C, D))
elif A + B - C + D == 7:
  print('{}+{}-{}+{}=7'.format(A, B, C, D))
elif A + B - C - D == 7:
  print('{}+{}-{}-{}=7'.format(A, B, C, D))
elif A - B + C + D == 7:
  print('{}-{}+{}+{}=7'.format(A, B, C, D))
elif A - B + C - D == 7:
  print('{}-{}+{}-{}=7'.format(A, B, C, D))
elif A - B - C + D == 7:
  print('{}-{}-{}+{}=7'.format(A, B, C, D))
elif A - B - C - D == 7:
  print('{}-{}-{}-{}=7'.format(A, B, C, D))


### FIXED CODE ###

abcd = input()
A,B,C,D = int(abcd[0]),int(abcd[1]),int(abcd[2]),int(abcd[3])    
if A + B + C + D == 7:
  print('{}+{}+{}+{}=7'.format(A, B, C, D))
elif A + B + C - D == 7:
  print('{}+{}+{}-{}=7'.format(A, B, C, D))
elif A + B - C + D == 7:
  print('{}+{}-{}+{}=7'.format(A, B, C, D))
elif A + B - C - D == 7:
  print('{}+{}-{}-{}=7'.format(A, B, C, D))
elif A - B + C + D == 7:
  print('{}-{}+{}+{}=7'.format(A, B, C, D))
elif A - B + C - D == 7:
  print('{}-{}+{}-{}=7'.format(A, B, C, D))
elif A - B - C + D == 7:
  print('{}-{}-{}+{}=7'.format(A, B, C, D))
else:
  print('{}-{}-{}-{}=7'.format(A, B, C, D))
n=int(input())
l=[int(i) for i in input().split()]
l.sort()
ans=0
for i in range(n-2):
  for j in range(i+1,n-1):
    for k in range(j+ans1,n):
      ans1=0
      elif l[i]+l[j]>l[-1]:
        ans+=n-j-1
        break
      if l[i]+l[j]<=l[k] :
        ans+=k-j-1
        ans1+=k-j-1
        break
      
      
print(ans)
      
        
        


### FIXED CODE ###

n=int(input())
l=[int(i) for i in input().split()]
l.sort()
ans=0
ans1=0
for i in range(n-2):
  for j in range(i+1,n-1):
    for k in range(j+ans1,n):
      ans1=0
      if l[i]+l[j]>l[-1]:
        ans+=n-j-1
        break
      elif l[i]+l[j]<=l[k] :
        ans+=k-j-1
        ans1+=k-j-1
        break
      
      
print(ans)
N,K = (int(x) for x in input().split())
R = N - K
mod = 10**9 + 7

def fact(n, k):
  r1 = 1
  r2 = 1
  for i in range(0, k):
      r1 *= (n - i)
      r2 *= (i + 1)
  r = r1/r2
  return r

ans = fact(R+1, 1)*fact(K-1,0)
for i in range(1,K+1):
  print(int(ans)%mod)
  if N - K + 1 < i:
    ans = 0
  else:
    ans = ans*(R - i + 1)*(K - i)/(i + 1)/i
  


### FIXED CODE ###

import math
N,K = (int(x) for x in input().split())
R = N - K
mod = 10**9 + 7

def fact(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

for i in range(1,K+1):
  if N - K + 1 < i:
    ans = 0
  else:
    ans = fact(R+1, i)*fact(K-1,i-1)
  print(int(ans)%mod)
a,b=input().split()
n,m=map(int,input().split())
c=input()
if a==c:
    print(a-1,b)
else:
    print(a,b-1)

### FIXED CODE ###

a,b=input().split()
n,m=map(int,input().split())
c=input()
if a==c:
    print(n-1,m)
else:
    print(n,m-1)
x = 2 * R * 3.14

print(x)

### FIXED CODE ###

import math

R = int(input())

print(R * 2 * math.pi)
a,b=input().split()
a=int(a)
b=int(b)
if a>=10:
  print(b)
else:
  print(int(b+100*(10-a))

### FIXED CODE ###

a,b=input().split()
a=int(a)
b=int(b)
if a>=10:
  print(b)
if a<10:
  print(b+(100*(10-a)))
S=input()
sf=int(S[:2])
sb=int(S[3:])
if 1<=sf and sf<=12:
  if 1<=sb and sb<=12:
    print("AMBIGUOUS")
  else:
    print("MMYY")
else:
  if 1<=sb and sb<=12:
    print("YYMM")
  else:
    print("NA")

### FIXED CODE ###

N,K=map(int,input().split())
ans=0
for i in range(N):
  p=i+1
  q=1/N
  while p<K:
    p*=2
    q*=1/2
  ans+=q

print(ans)
n = int(input())
apple = []
for _ in range(n):
    a = int(input())
    if a not in apple:
        apple.append(a)
    else:
        apple.remove(a)
print(len(apple))

### FIXED CODE ###

n = str(input())
print("Yes" if "9" in n else "No")
import math
from typing import List, NoReturn, Tuple


def main() -> NoReturn:
    n: int = int(input())
    # 0.9615384615384616 == 25 / 26
    group: int = math.ceil(math.log(0.9615384615384616 * n + 1, 26))
    in_group_index: int = n - (26 * (26 ** (group - 1) - 1)) // 25

    if in_group_index == 0:
        print("z" * (group - 1))
        return
    else:
        alphabet_num: List[int] = []
        alphabet: str = "abcdefghijklmnopqrstuvwxyz"
        temp = in_group_index
        for i in range(group - 1, -1, -1):
            alphabet_num.append(temp // 26 ** i)
            temp %= 26 ** i
        else:
            alphabet_num[-1] -= 1
        name_chars: List[str] = [alphabet[i] for i in alphabet_num]
        print("".join(name_chars))


if __name__ == '__main__':
    main()


### FIXED CODE ###

import math
from typing import List, NoReturn, Tuple


def main() -> NoReturn:
    n: int = int(input())
    # 0.9615384615384616 == 25 / 26
    group: int = math.ceil(math.log(0.9615384615384616 * n + 1, 26))
    in_group_index: int = n - 1 - (26 * (26 ** (group - 1) - 1)) // 25

    alphabet_num: List[int] = []
    alphabet: str = "abcdefghijklmnopqrstuvwxyz"
    temp = in_group_index
    for i in range(group - 1, -1, -1):
        alphabet_num.append(temp // 26 ** i)
        temp %= 26 ** i
    name_chars: List[str] = [alphabet[i] for i in alphabet_num]
    print("".join(name_chars))


if __name__ == '__main__':
    main()
import sys

input = lambda: sys.stdin.readline().rstrip()


def comb(n, k):

    if n < k:
        return 0

    m = 1
    for i in range(n, n - k, -1):
        m = m * i

    n = 1
    for i in range(1, k + 1):
        n = n * i

    return (m // n)


def solve():

    N, K = map(int, input().split())
    A = list(map(int, input().split()))
    S = [0 for _ in range(N + 1)]

    for i in range(N):
        S[i + 1] = S[i] + A[i] - 1

    if N < K:
        d = dict()
        for i in range(N + 1):
            k = S[i] % K
            if d[k]:
                d[k] += 1
            else:
                d[k] = 1

        ans = 0
        for k, v in d.items():
            ans += comb(v, 2)

        print(ans)
        exit()

    elif N >= K:

        ans = 0
        d = dict()

        # first
        kf = S[0] % K
        for i in range(K):
            k = S[i] % K
            if k in d:
                d[k] += 1
            else:
                d[k] = 1

        for k, v in d.items():
            ans += comb(v, 2)

        # slide
        for i in range(1, N + 1 - K):
            d[kf] -= 1
            kf = S[i] % K
            k = S[i + K] % K
            if k in d:
                ans += d[k]
                d[k] += 1
            else:
                d[k] = 1

    print(ans)
    exit()


if __name__ == '__main__':
    solve()


### FIXED CODE ###

import sys
import bisect
input = lambda: sys.stdin.readline().rstrip()


def solve():

    N, K = map(int, input().split())
    A = list(map(int, input().split()))
    S = [0 for _ in range(N + 1)]

    for i in range(N):
        S[i + 1] = S[i] + A[i] - 1

    d = dict()
    for i in range(N + 1):
        k = S[i] % K
        if k in d:
            d[k].append(i)
        else:
            d[k] = [i]

    # print(d)

    ans = 0
    for k, v in d.items():
        if len(v) <= 1:
            continue
        else:
            for i in range(len(v)):
                s = v[i] + K - 1
                si = bisect.bisect_right(v, s)
                ans += (si - i) - 1
                # print(i, si)

    print(ans)


if __name__ == '__main__':
    solve()
s = list(input())
k = int(input())
n = len(s)
s += ' '

l = []
cnt = 1
for i in range(1, n + 1):
    if s[i - 1] != s[i]:
        l.append(cnt)
        cnt = 1
    else:
        cnt += 1
m = sum(map(lambda li: li // 2, l))
if s[0] == s[-2]:
    if len(l) == 1:
        ans = k * n // 2
    elif l[0] % 2 == l[-1] % 2 == 1:
        ans = k * m + k - 1
    else:
        ans = k * m
print(ans)

### FIXED CODE ###

s = list(input())
k = int(input())
n = len(s)
s.append(' ')

l = []
cnt = 1
for i in range(1, n + 1):
    if s[i - 1] != s[i]:
        l.append(cnt)
        cnt = 1
    else:
        cnt += 1
m = sum(map(lambda li: li // 2, l))
if len(l) == 1:
    ans = k * n // 2
elif s[0] == s[-2] and l[0] % 2 == l[-1] % 2 == 1:
    ans = k * m + k - 1
else:
    ans = k * m
print(ans)
def next_check(cubes):
	index_list = []
	for cube_index in range(1, len(cubes)):
		if cube_index not in index_list and cubes[cube_index] == cubes[cube_index - 1]:
			index_list.append(cube_index - 1)
			index_list.append(cube_index)
	l = len(index_list)
	for i in reversed(index_list):
		cubes.pop(i)
	return (cubes, l)


cubes = input()
for c in cubes:
	if c not in ['0', '1']:
		exit(0)
cube_list = []
for cube in cubes:
	cube_list.append(cube)
l = len(cube_list)
k = 0
while (l != 0):
	cubes, l = next_check(cube_list)
	k += l
print(k)


### FIXED CODE ###

S = input()

num_0 = S.count('0')
num_1 = S.count('1')

print(min(num_0, num_1)*2)
N=int(input())
L=[input() for i in range(N)]
M=int(input())
S=[input() for i in range(M)]
A=[0]
for i in range(N):
  A.append(L.count(L[i])-S.count(S[i]))

print(max(A))

### FIXED CODE ###

N=int(input())
L=[input() for i in range(N)]
M=int(input())
S=[input() for i in range(M)]
A=[0]
for i in range(N):
  A.append(L.count(L[i])-S.count(L[i]))
 
print(max(A))
from itertools import permutations
N = int(input())

o = {}
for i, p in enumerate(permutation(range(1,N+1))):
  	o[p] = i
P = tuple(int(x) for x in input().split())
Q = tuple(int(x) for x in input().split())
print(abs(o[P] - o[Q]))

### FIXED CODE ###

from itertools import permutations
N = int(input())

o = {}
for i, p in enumerate(permutations(range(1,N+1))):
  	o[p] = i
P = tuple(int(x) for x in input().split())
Q = tuple(int(x) for x in input().split())
print(abs(o[P] - o[Q]))
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    s=list(input())+['T']
    x,y=map(int,input().split())
    x+=10000
    y+=10000
    ud=[]
    lr=[]
    f=0
    f2=0
    c=0
    for t in s:
        if t=='F':
            if not f:
                x-=1
            else:
                c+=1
        else:
            f=1
            if c:
                if f2:
                    ud.append(c)
                else:
                    lr.append(c)
            c=0
            f2=not f2
    for l,z in [(ud,y),(lr,x)]:
        N=len(l)
        dp=[0]*(N+1)
        dp[0]=1<<10000
        for i in range(N):
            dp[i+1]|=dp[i]<<l[i]|dp[i]>>l[i]
        if not (dp[-1]>>z)&1:
            print('No')
            break
    else:
        print('Yes')
        
    

if __name__ == '__main__':
    main()


### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    s=list(input())+['T']
    x,y=map(int,input().split())
    x+=16000
    y+=16000
    ud=[]
    lr=[]
    f=0
    f2=0
    c=0
    for t in s:
        if t=='F':
            if not f:
                x-=1
            else:
                c+=1
        else:
            f=1
            if c:
                if f2:
                    ud.append(c)
                else:
                    lr.append(c)
            c=0
            f2=not f2
    for l,z in [(ud,y),(lr,x)]:
        N=len(l)
        dp=[0]*(N+1)
        dp[0]=1<<16000
        for i in range(N):
            dp[i+1]|=dp[i]<<l[i]|dp[i]>>l[i]
        if not (dp[-1]>>z)&1:
            print('No')
            break
    else:
        print('Yes')
        
    

if __name__ == '__main__':
    main()
N,M=map(int,input().split())
Xa={}
ans=0
for i in range(N):
    V,S=map(int,input().split())
    Xa[V]=S
Xb=sorted(Xa.items())
for i in range (N) :
    M -= Xb[i][1]
    ans += Xb[i][0]*Xb[i][1]
    if M < 0 :
        ans -= abs(M)*Xb[i][0]
        break
print(ans)

### FIXED CODE ###

N,M=map(int,input().split())
Xa={}
ans=0
for i in range(N):
    V,S=map(int,input().split())
    if V in Xa :
        Xa[V] += S
    else :
        Xa[V]=S
Xb=sorted(Xa.items())
for i in range (len(Xb)) :
    M -= Xb[i][1]
    ans += Xb[i][0]*Xb[i][1]
    if M <= 0 :
        ans -= abs(M)*Xb[i][0]
        break
 
print(ans)
k=int(input())
l=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(l[k-1])k

### FIXED CODE ###

k=int(input())
l=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(l[k-1])
s=input()
ans=0
for i in range(len(s)):
  l=0
  for j in range(i:len(s)):
    if s[j] in ["A","T","G","C"]:
      l+=1
    else:
      break
  ans=max(ans,l)
print(ans)

### FIXED CODE ###

s=input()
ans=0
for i in range(len(s)):
  l=0
  for j in range(i,len(s)):
    if s[j] in ["A","T","G","C"]:
      l+=1
    else:
      break
  ans=max(ans,l)
print(ans)
# ABC134
import sys
input = sys.stdin.readline

def main():
    n = int(input())
    A = list(map(int, [input() for _ in range(n)]))
    SA = sorted(set(A))
    ma, ma2 = SA[-1], SA[-2]
    ans = [ma if i != ma else ma2 for i in A]
    print(*ans, sep="\n")


if __name__ == "__main__":
    main()

### FIXED CODE ###

# ABC134
import sys
input = sys.stdin.readline

def main():
    n = int(input())
    A = list(map(int, [input() for _ in range(n)]))
    SA = sorted(A)
    ma, ma2 = SA[-1], SA[-2]
    ans = []
    for i in A:
        if i != ma:
            ans += [ma]
        else:
            ans += [ma2]
    print(*ans, sep="\n")


if __name__ == "__main__":
    main()
a, b, c, x, y=map(int, input().split())
m=2＊x＊c
n=c＊y＊2+a＊(x-y)
d=2＊y＊c
e=c＊x＊2+b＊(y-x)
f=a＊x+b＊y
g=min(m,n,f)
h=min(d,e,f)
if x>=y:
    print(g)
else:
    print(h)


### FIXED CODE ###

a, b, c, x, y = map(int, input().split())
res = 0
if a+b > c*2:
    mi = min(x, y)
    res += c*2 * mi
    x -= mi
    y -= mi
res += x * min(a, c*2)
res += y * min(b, c*2)
print(res)
a, b = map(int, input())

res = 0
for i in range(a, b + 1):
    i_str = str(i)
    if i_str == i_str[::-1]:
        res += 1
print(res)


### FIXED CODE ###

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

res = 0
for i in range(a, b + 1):
    i_str = str(i)
    if i_str == i_str[::-1]:
        res += 1
print(res)
n,k=map(int,input().split())
s=input()

s1=s[:k+1]
s2=s[k+1]
s3=s[k+2:]

if s2=="A":
    s2="a"
elif s2=="B":
    s2="b"
else:
    s2="c"

print(s1+s2+s3)


### FIXED CODE ###

n,k=map(int,input().split())
s=input()

s=s[:k-1]+s[k-1].lower()+s[k:]

print(s)
n=input();a=input();b=input();c=input();d=input();e=input()
turn=1
turn+=n//a+1
if n%a==0 and n!=a:
  A=n/a
elif n==a:
  A=n
else:
  A=n%a
turn+=A//b+1
if A%b==0 and A!=b:
  B=A/b
elif A==b:
  B=A
else:
  B=A%b
turn+=B//c+1
if B%c==0 and B!=c:
  C=B/c
elif B==c:
  C=B
else:
  C=B%c
turn+=C//d+1
if C%d==0 and C!=d:
  D=C/d
elif C==d:
  D=C
else:
  D=C%d
turn+=D//e+1
print(turn)

### FIXED CODE ###

N = int(input())
cnt = int()
A=[]
for i in range(5):
    A.append(int(input()))
A.sort()
print(-(-N//min(A))+4)
import math

X, N = list(map(int, input().split()))
p = list(map(int, input().split()))
# print(X, N, p)

if N == 0:
    print(X)
    exit()

if X < minimum or maximum < X:
    print(X)
    exit()

answer = 1
for candidate in range(1, 100 + 1):
    if candidate in p : continue

    diff_candidate = abs(X - candidate)
    diff_answer = abs(X - answer)

    if diff_candidate == diff_answer:
        answer = min(candidate, answer)
    elif diff_candidate < diff_answer:
        answer = candidate

print(answer)


### FIXED CODE ###

import math

X, N = list(map(int, input().split()))
p = list(map(int, input().split()))
# print(X, N, p)

if N == 0:
    print(X)
    exit()

p.sort()

minimum = p[0]
maximum = p[len(p) - 1]

if X < minimum or maximum < X:
    print(X)
    exit()

diff_min = abs(X - minimum - 1)
diff_max = abs(X - maximum + 1)
if diff_min == diff_max:
    answer = min(minimum - 1, maximum + 1)
else:
    answer = minimum - 1 if diff_min < diff_max else maximum + 1

for candidate in range(0, 100 + 2):
    if candidate in p : continue

    diff_candidate = abs(X - candidate)
    diff_answer = abs(X - answer)

    if diff_candidate == diff_answer:
        answer = min(candidate, answer)
    elif diff_candidate < diff_answer:
        answer = candidate

print(answer)
N,R = input().split()
if N > 10:
  print(R)
else:
  R + (100 * (10 - N))

### FIXED CODE ###

N,R = map(int, input().split())
if N > 10:
  print(R)
else:
  print(R + (100 * (10 - N)))
n=int(input())
mod=10**9+7
import math
import sympy
v=math.factorial(n)
print(sympy.divisor_count(v)%mod)

### FIXED CODE ###

n=int(input())
import math
fac=math.factorial(n)
mod=10**9+7
ans=[0]*(n+1)
ans[0]=ans[1]=1
i=2
while i*i<=n:
    j=2
    while i*j<=n and ans[i]==0:
        ans[i*j]=1
        j+=1
    i+=1
v=[]
for i in range(n+1):
    if ans[i]==0:
        v.append(i)
total=1
count=0
for i in v:
    while fac%i==0:
        count+=1
        fac//=i
    total*=count+1
    count=0
print(total%mod)
a=int(input())
p=3.141592
print("{0:.9f} {1:.9f}".format(a*a*p,a*2*p))


### FIXED CODE ###

import math
a=float(input())
print("{0:.9f} {1:.9f}".format(a*a*math.pi,a*2*math.pi))
N, K = map(int, input().split())
A = [int(input()) for i in range(N)]
 
ans = []
 
i = 0
while(i<=N-1):
  a = A[i]
  T = 1
  b = i
  while (b<=N-2):
    if ( abs(a-A[b+1]) <= K ):
      T += 1
      a = A[b+1]
    else:
      T += 0
    b += 1
  ans.append(T)
  i += 1
  
print(max(ans))

### FIXED CODE ###

K = int(input())
A = ""
for i in range(K):
  A += "ACL"
  
print(A)
N = int(input())
li = list(map(int,input().split()))
ans = []
for i in range(N):
  ans.append(li.find(i+1) + 1)
for i in range(N):
  print(ans[i],end=' ')


### FIXED CODE ###

import sys
input = sys.stdin.readline

N = int(input())
li = list(map(int,input().split()))
ans = [0] * N
for i in range(N):
    ans[li[i]-1] = i+1
for j in range(N):
    print(ans[j],end = ' ')
total = int(input())
text = input()

res = 0

if total >= 3:
    for x in range(0, total - 1):
        if text[x] == "A":
            if x + 2 <= total:
                if text[x + 1] == "B" and text[x + 2] == "C":
                    res += 1

print(res)

### FIXED CODE ###

total = int(input())
text = input()

res = 0

if total >= 3:
    for x in range(0, total - 1):
        if text[x] == "A":
            if x + 3 <= total:
                if text[x + 1] == "B" and text[x + 2] == "C":
                    res += 1

print(res)