Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

import sys
 
n, m = [int(i) for i in input().split(" ")]
p = [0] + [int(i) for i in input().split(" ")]
par = [i for i in range(0, n + 1)]
id_set = [[i] for i in range(0, n + 1)]
p_set = [[p[i]] for i in range(0, n + 1)]

sys.setrecursionlimit(10**6)
 
def root(x):
    if par[x] == x:
        return x
    else:
        r = root(par[x])
        par[x] = r
        return r

def unite(x, y):
    x = root(x)
    y = root(y)
    if x == y:
        return
    else:
        par[x] = y
        id_set[y] = id_set[x] + id_set[y]
        p_set[y] = p_set[x] + p_set[y]

for i in range(0, m):
    x, y = [int(i) for i in input().split(" ")]
    unite(x, y)
    
s = 0
for i in range(1, n + 1):
    if i == root(i):
        s += len(set(id_set[i]) & set(p_set[i]))

print(s)

### FIXED CODE ###

import sys
 
n, m = [int(i) for i in input().split(" ")]
p = [0] + [int(i) for i in input().split(" ")]
par = [i for i in range(0, n + 1)]
id_set = [[] for i in range(0, n + 1)]
p_set = [[] for i in range(0, n + 1)]

sys.setrecursionlimit(10**6)
 
def root(x):
    if par[x] == x:
        return x
    else:
        r = root(par[x])
        par[x] = r
        return r

def unite(x, y):
    x = root(x)
    y = root(y)
    if x == y:
        return
    else:
        par[x] = y

for i in range(0, m):
    x, y = [int(i) for i in input().split(" ")]
    unite(x, y)

for i in range(1, n + 1):
    r = root(i)
    id_set[r].append(i)
    p_set[r].append(p[i])
    
s = 0
for i in range(1, n + 1):
    if i == root(i):
        id_i = sorted(id_set[i])
        p_i = sorted(p_set[i])
        k = 0
        for j in range(0, len(id_i)):
            while k < len(p_i) and p_i[k] < id_i[j]:
                k += 1
            if k >= len(p_i):
                break
            if p_i[k] == id_i[j]:
                s += 1

print(s)
### BUGGY CODE ###

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

newLi = sorted(t, reverse=True)
li = []

for i in range(N):
  k = [newLi.pop(0), newLi.pop(0), newLi.pop(-1)]
  li.append(k)

ans = 0

for s in li:
  ans += s[1]

print(ans)

### FIXED CODE ###

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

newLi = sorted(t, reverse=True)
ans = 0

for i in range(N):
  ans += newLi[i * 2 + 1]

print(ans)
### BUGGY CODE ###

import sys
from functools import lru_cache
sys.setrecursionlimit(1000000)
input=sys.stdin.readline

N = int(input())
par = {i:[] for i in range(1, N+1)}
for i in range(2, N+1):
    a = int(input())
    par[a].append(i)

@lru_cache(maxsize=None)
def dfs(s):
    depth = 1
    res = sorted(dfs(t) for t in par[s])[::-1]
    for i, j in enumerate(res, start=1):
        depth = max(depth, i+j)
    return depth

print(dfs(1)-1)

### FIXED CODE ###

import sys
from functools import lru_cache
sys.setrecursionlimit(1000000)
input=sys.stdin.readline


N = int(input())
par = {i:[] for i in range(1, N+1)}

for i in range(2, N+1):
    a = int(input())
    par[a].append(i)

@lru_cache(maxsize=None)
def dfs(s):
    depth = 1
    res = []
    for t in par[s]:
        res.append(dfs(t))
    res.sort(reverse=True)
    for i, j in enumerate(res, start=1):
        depth = max(depth, i+j)
    return depth

print(dfs(1)-1)
### BUGGY CODE ###

N = int(input())
P = list(map(int,input().split()))
ans_count=N
for i in range(1,N):
    if(P[i]>=min(P[:i])):
        ans_count-=1
print(ans_count)



### FIXED CODE ###

N = int(input())
P = list(map(int,input().split()))
minP = P[0]
ans = 1
for i in P[1:]:
    if(i<=minP):
        minP = i
        ans += 1
print(ans)
### BUGGY CODE ###

# -*- coding: utf-8 -*-
 
import math
import itertools
import sys
import copy
 
# 入力
#A, B, C, D = map(int, input().split())
#L = list(map(int, input().split()))
#S = list(str(input()))
#N = int(input())
N, M = map(int, input().split())
L = []
for _ in range(M) :
  L.append(list(map(str, input().split())))
#print(L)
  
D = {}
for i in range(M) :
  if L[i][0] not in D :
    D[L[i][0]] = L[i][1]
  else :
    if L[i][1] == "AC" :
      D[L[i][0]] = L[i][1]

ACsum = 0
ACList = []
for mykey, myvalue in D.items() :
  if myvalue == "AC" :
    ACsum += 1
    ACList += [mykey]
    
#print(ACList)
ACEnd = []
WAsum = 0
for i in range(M) :
  if L[i][0] in ACList and L[i][0] not in ACEnd :
    if L[i][1] != "AC" :
      WAsum += 1
    else :
      ACEnd.append(L[i][0])

print(str(ACsum) + " " + str(WAsum))

### FIXED CODE ###

# -*- coding: utf-8 -*-
 
import math
import itertools
import sys
import copy
 
# 入力
#A, B, C, D = map(int, input().split())
#L = list(map(int, input().split()))
#S = list(str(input()))
#N = int(input())
N, M = map(int, input().split())
L = []
for _ in range(M) :
  L.append(list(map(str, input().split())))
#print(L)

A = [[0 for _ in range(2)] for _ in range(N+1)]

for i in range(M) :
  if L[i][1] == "WA" and A[int(L[i][0])][1] != 1:
    A[int(L[i][0])][0] += 1
  else :
    A[int(L[i][0])][1] = 1

#print (A)
ACsum = 0
WAsum = 0
for j in range(N+1) :
  if A[j][1] == 1 :
    ACsum += 1
    WAsum += A[j][0]
  
print(str(ACsum) + " " + str(WAsum))
### BUGGY CODE ###

n = int(input())
xss = [[int(x)-1 for x in input().split()] for _ in range(n)]

class Stack:
    def __init__(xs):
        self.__list = list(reversed(xs))

    def peak(self):
        return self.__list[-1]

    def pop(self):
        return self.pop()

def solve(n, xss):
    yss = [[-1] + list(reversed(xs)) for xs in xss]
    ans = 0
    while True:
        ms = list(matches(yss))
        if len(ms) == 0:
            if all(len(ys)==1 for ys in yss):
                return ans
            else:
                return -1
            return ans
        ans += 1
        for x, y in ms:
            yss[x].pop()
            yss[y].pop()

    for i in range(n):
        while len(yss[i]) > 0:
            match = find_first_match(yss, i)
            if match is None:
                return [-1]
            x, y = match
            ans

def matches(yss):
    firsts = [ys[-1] for ys in yss]
    for x, y in enumerate(firsts):
        if y!=-1 and x < y and firsts[y]==x:
            yield y, firsts[y]

print(solve(n, xss))

### FIXED CODE ###

n = int(input())
xss = [[int(x)-1 for x in input().split()] for _ in range(n)]

def solve(n, xss):
    yss = [[-1] + list(reversed(xs)) for xs in xss]
    ans = 0
    candidates = range(n)
    while True:
        #print(" ".join(map(str, candidates)))
        ms = list(matches(yss, candidates))
        if len(ms) == 0:
            if all(len(ys)==1 for ys in yss):
                return ans
            else:
                return -1
        ans += 1
        candidates = []
        #print(" ".join(map(str, ms)))
        for x, y in ms:
            yss[x].pop()
            yss[y].pop()
            candidates.append(x)
            candidates.append(y)

def matches(yss, candidates):
    firsts = [yss[i][-1] for i in candidates]
    ans = set()
    for x, y in zip(candidates, firsts):
        if y!=-1 and yss[y][-1] ==x:
            ans.add((min(x, y), max(x, y)))
    return ans

print(solve(n, xss))
### BUGGY CODE ###

# LCS: Longest common subsequence
# dp[i][j]: Sのi-1番目まで, Tのj-1番目まででの最長共通文字列
# dp[0][0] = 0 長さ0の文字列
# dp[0][1] = 0 長さ1の文字列と長さ0の文字列
# dp[1][0] = 0 長さ0の文字列と長さ1の文字列
# dp[i][j] = max(dp[i-1][j], dp[i][j-1]) (S[i] != T[j])
# dp[i][j] = max(
#                dp[i-1][j-1]+1  (共通文字列を利用する),
#                dp[i-1][j]        (共通文字列を利用しない),
#                dp[i][j-1]        (共通文字列を利用しない),
#            )



def main():
    S = input()
    T = input()

    result = solve(S, T)
    print(result)

def solve(S, T):
    dp = [['' for _ in range(len(T)+1)] for _ in range(len(S)+1)]
    for i in range(1, len(S)+1):
        for j in range(1, len(T)+1):
            if S[i-1] != T[j-1]:
                dp[i][j] = max(dp[i-1][j], dp[i][j-1])
                if len(dp[i-1][j]) >= len(dp[i][j-1]):
                    dp[i][j] = dp[i-1][j]
                else:
                    dp[i][j] = dp[i][j-1]
            else:
                a = len(dp[i-1][j-1]) + 1
                b = len(dp[i-1][j])
                c = len(dp[i][j-1])
                if a >= b and a >= c:
                    dp[i][j] = dp[i-1][j-1] + S[i-1]
                elif b>=a and b>= c:
                    dp[i][j] = dp[i-1][j]
                else:
                    dp[i][j] = dp[i][j-1]
    return dp[len(S)][len(T)]


if __name__ == "__main__":
    main()


### FIXED CODE ###

# LCS: Longest common subsequence
# dp[i][j]: Sのi-1番目まで, Tのj-1番目まででの最長共通文字列
# dp[0][0] = 0 長さ0の文字列
# dp[0][1] = 0 長さ1の文字列と長さ0の文字列
# dp[1][0] = 0 長さ0の文字列と長さ1の文字列
# dp[i][j] = max(dp[i-1][j], dp[i][j-1]) (S[i] != T[j])
# dp[i][j] = max(
#                dp[i-1][j-1]+1  (共通文字列を利用する),
#                dp[i-1][j]        (共通文字列を利用しない),
#                dp[i][j-1]        (共通文字列を利用しない),
#            )


dp = [[0 for _ in range(3001)] for _ in range(3001)]


def main():
    S = input()
    T = input()

    result = solve(S, T)
    print(result)


def solve(S, T):
    for i in range(1, len(S) + 1):
        for j in range(1, len(T) + 1):
            if S[i - 1] != T[j - 1]:
                dp[i][j] = max(dp[i - 1][j], dp[i][j - 1], dp[i-1][j-1])
            else:
                dp[i][j] = max(dp[i - 1][j - 1] + 1, dp[i - 1][j], dp[i][j - 1])
    result = ""
    i = len(S)
    j = len(T)
    while dp[i][j] != 0:
        if dp[i][j] == dp[i-1][j]:
            i -= 1
        elif dp[i][j] == dp[i][j-1]:
            j -= 1
        else:
            result += S[i-1]
            i -= 1
            j -= 1
    return "".join(reversed(result))


if __name__ == "__main__":
    main()
### BUGGY CODE ###

n,W=map(int,input().split())

ans=[[0]*(W+1) for _ in range(n)]

for i in range(0,n):
    w,v=map(int,input().split())
    for j in range(1,W+1):
        p=0
        if j>=w :
            p=ans[i-1][j-w]+v
        ans[i][j]=max(ans[i-1][j],p)

print(ans[-1][W])



### FIXED CODE ###

n,W=map(int,input().split())
values=[]
weights=[]

for _ in range(n):

    a,b=map(int,input().split())
    weights.append(a)
    values.append(b)

ans=[[0]*(W+1) for _ in range(n)]

for i in range(0,n):
    for j in range(1,W+1):
        p=0
        if j>=weights[i] :
            p=ans[i-1][j-weights[i]]+values[i]
        ans[i][j]=max(ans[i-1][j],p)

print(ans[-1][W])
### BUGGY CODE ###

import bisect

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

l.sort()
ans = 0
for i in range(n-2):
    for j in range(i+1, n-1):
        a = bisect.bisect_right(l, l[j]-l[i])
        b = bisect.bisect_left(l, l[i]+l[j])
        a = max(j+1, a)
        b = max(j+1, b)
        ans += b - a

print(ans)

### FIXED CODE ###

from bisect import bisect_left

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


a.sort()
count = 0

for i in range(n-2):
    for j in range(i+1, n-1):
        x = bisect_left(a, a[i] + a[j])
        count += x - (j+1)

print(count)
### BUGGY CODE ###

def reachable(lines, through, a, b):
    if a == b:
        return True
    lines = lines[:]
    lines.remove(through)
    for line in lines:
        if b in line and reachable(lines, line, a, line[line.index(b) - 1]):
            return True
    return False

N, M = map(int, input().split())
lines = [input().split() for _ in range(M)]
print(M - sum(reachable(lines, line, *line) for line in lines))

### FIXED CODE ###

class UnionFind():
    #負の値はルートで集合の個数
    #正の値は次の要素を返す
    def __init__(self,size):
        self.table = [-1 for _  in range(size)]

    #集合の代表を求める
    def find(self,x):
        while self.table[x] >= 0:
            #根に来た時,self.table[根のindex]は負の値なのでx = 根のindexで値が返される。
            x = self.table[x]
        return x

    #併合
    def union(self,x,y):
        s1 = self.find(x)#根のindex,table[s1]がグラフの高さ
        s2 = self.find(y)
        if s1 != s2:#根が異なる場合
            if self.table[s1] != self.table[s2]:#グラフの高さが異なる場合
                if self.table[s1] < self.table[s2]:
                    self.table[s2] = s1
                else:
                    self.table[s1] = s2
            else:
                #グラフの長さが同じ場合,どちらを根にしても変わらない
                #その際,グラフが1長くなることを考慮する
                self.table[s1] += -1
                self.table[s2] = s1
        return

N,M = list(map(int,input().split()))
A = []
B = []
for i in range(M):
    a,b = map(int,input().split())
    A.append(a-1)
    B.append(b-1)

res = 0

for i in range(M):
    G = UnionFind(N)
    for j in range(M):
        if i != j:
            G.union(A[j],B[j])
    minas = 0
    for k in G.table:
        if k < 0:
            minas += 1
    if minas == 1:
        res += 1


print(M-res)
### BUGGY CODE ###

h,w,d = [int(i) for i in input().split()]
a = [[int(i) for i in input().split()] for i in range(h)]
q = int(input())
lr = [[int(i) for i in input().split()] for i in range(q)]

def abs(c): 
    if c > 0: 
        return c 
    else: 
        return -c
    
def distance_2d(a,b):
    return(abs(a[0]-b[0])+abs(a[1]-b[1]))
    

def search_2d(a,key):
    x = -1
    y = -1
    for i in range(0,len(a)):
        for j in range(0,len(a[0])):
            if a[i][j] == key:
                x = i
                y = j
        if x != -1:
            break
    
    return([x,y])
 
for i in range(0,q):
    power = 0
    for j in range(lr[i][0],lr[i][1]-d+1,d):
        power += distance_2d(search_2d(a,j),search_2d(a,j+d))
    print(power)


### FIXED CODE ###

def list_1d(d,v):
    return [ v for i in range(d)]

def abs(c): 
    if c > 0: 
        return c 
    else: 
        return -c

def distance_2d(a,b):
    return(abs(a[0]-b[0])+abs(a[1]-b[1]))

h,w,d = [int(i) for i in input().split()]
sa = list_1d(h*w+1,[])
da = list_1d(h*w+1,0)
for i in range(h):
    a = [int(k) for k in input().split()]
    for j in range(w):
        sa[a[j]] = [i,j]
q = int(input())
lr = [[int(i) for i in input().split()] for i in range(q)]

for i in range(d+1,h*w+1):
    da[i] = da[i-d] + distance_2d(sa[i],sa[i-d])

for i in range(0,q):
    print(da[lr[i][1]]-da[lr[i][0]])
### BUGGY CODE ###

N,K = map(int, input().strip().split())
P = list(map(int, input().strip().split()))
P = [(p+1)/2 for p in P]

ans = 0
for i in range(N-K+1):
  ans = max(ans, sum(P[i:i+K]))
print(ans)


### FIXED CODE ###

N,K = map(int, input().strip().split())
P = list(map(int, input().strip().split()))
P = [(p+1)/2 for p in P]

ans = sum(P[0:K])
now = ans
for i in range(1,N-K+1):
  now = now - P[i-1] + P[i+K-1]
  ans = max(ans, now)
print(ans)
### BUGGY CODE ###

# coding: utf-8

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

def f2(n):
    dp = [[0] * n for _ in range(n)]

    def dfs(i, j):  # from i to j
        # print(i, "->", j)
        if dp[i][j]:
            return(dp[i][j])
        dpij = 1
        for u in U[i]:
            if u != j:
                dpij *= dfs(u, i) + 1
        dp[i][j] = dpij
        return(dpij)

    for i in range(n):
        ans = 1
        for u in U[i]:
            ans *= dfs(u, i) + 1
        print(ans % M)

N, M = map(int, input().split()) # 1 <= N <= 10^5, 2 <= M <= 10^9
U = [set() for _ in range(N)]
for x, y in [map(int, input().split()) for _ in range(N - 1)]:
    U[x - 1].add(y - 1)
    U[y - 1].add(x - 1)
f2(N)


### FIXED CODE ###

# coding: utf-8

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

def dfs(v, p = -1):
    deg[v] = len(U[v])
    dp[v] = [0] * deg[v]
    ans = 1
    for i in range(deg[v]):
        u = U[v][i]
        if u == p:
            par[v] = i
            continue
        dp[v][i] = dfs(u, v)
        ans *= dp[v][i] + 1
        ans %= M
    return(ans)

def bfs(v, ans_p = 0, p = -1):
    if p != -1:
        dp[v][par[v]] = ans_p
    lmul = [1] * (deg[v] + 1)
    rmul = [1] * (deg[v] + 1)
    for i in range(1, deg[v] + 1):
        lmul[i] = lmul[i - 1] * (dp[v][i - 1] + 1) % M
        rmul[-i - 1] = rmul[-i] * (dp[v][-i] + 1) % M
    ans[v] = rmul[0]
    for i in range(deg[v]):
        u = U[v][i]
        if u == p:
            continue
        bfs(u, lmul[i] * rmul[i + 1] % M, v)

N, M = map(int, input().split()) # 1 <= N <= 10^5, 2 <= M <= 10^9
U = [list() for _ in range(N)]
for x, y in [map(int, input().split()) for _ in range(N - 1)]:
    U[x - 1].append(y - 1)
    U[y - 1].append(x - 1)
deg = [0] * N
par = [0] * N
dp = [None] * N
ans = [0] * N
dfs(0)
bfs(0)
print("\n".join([str(x) for x in ans]))
### BUGGY CODE ###

import math
a,b,n=map(int,input().split())
l=[i/b for i in range(1,n+1)]
m=[math.floor(a*s)-a*math.floor(s) for s in l]

print(max(m))

### FIXED CODE ###

a,b,n=map(int,input().split())
if b>n:
    print(int(a*n/b)-a*int(n/b))
else:
    print(int(a*(b-1)/b)-a*int((b-1)/b))
### BUGGY CODE ###

N = int(input())
S = input()

memo = [set()]*4
def dp(n):
  for i in range(4, n+1):
    if i == 4:
      t = {S[:j]+S[j+1:i] for j in range(i)}
      memo.append(t)
    else:
      t = {a[:-1]+S[i-1] for a in memo[i-1]}
      u = {a[0]+a[2]+S[i-1] for a in memo[i-1]}
      v = {a[1:]+S[i-1] for a in memo[i-1]}
      memo.append(memo[i-1] | t | u | v)
  return len(memo[n])

print(dp(N))  

### FIXED CODE ###

N = int(input())
S = input()

ans = 0
for i in range(10):
  a = S.find(str(i))
  if a != -1:
    for j in range(10):
      b = S.find(str(j), a+1)
      if b != -1:
        for k in range(10):
          c = S.find(str(k), b+1)
          if c != -1:
            ans += 1
print(ans)
### BUGGY CODE ###

N, X, Y = map(int, input().split())

X -= 1
Y -= 1

print(N)

def disdance(i, j):
    if i <= X and j >= Y:
        return X - i + j - Y + 1
    elif i >= X and j <= Y:
        return min(j - i, i - X + Y - j + 1)
    elif i >= X and j >= Y:
        return min(j - i, i - X + j - Y + 1)
    elif i <= X and j <= Y:
        return min(j - i, X - i + Y - j + 1)

for k in range(2, N):
    count = 0
    for i in range(N - 1):
        for j in range(i + 1, N):
            count += (disdance(i, j) == k)
    print(count)


### FIXED CODE ###

N, X, Y = map(int, input().split())

print(N)

X -= 1
Y -= 1

def disdance(i, j):
    if i <= X and j >= Y:
        return X - i + j - Y + 1
    elif i >= X and j <= Y:
        return min(j - i, i - X + Y - j + 1)
    elif i >= X and j >= Y:
        return min(j - i, i - X + j - Y + 1)
    elif i <= X and j <= Y:
        return min(j - i, X - i + Y - j + 1)

d = [0] * N

for i in range(N - 1):
    for j in range(i + 1, N):
        d[disdance(i, j)] += 1

for k in range(2, N):
    print(d[k])
### BUGGY CODE ###

N,K=map(int,input().split())
H=list(map(int,input().split()))
dp=[0]*N

for i in range(N-1):
  A=[]
  for j in range(K):
    if i-j>=0:
      A.append(dp[i-j]+abs(H[i-j]-H[i+1]))
  dp[i+1]=min(A)

print(dp[N-1])

### FIXED CODE ###

N,K=map(int,input().split())
H=list(map(int,input().split()))
dp=[0]*N

for i in range(N-1):
  A=[]
  for j in range(K):
    if i-j>=0:
      A.append(dp[i-j]+abs(H[i-j]-H[i+1]))
  dp[i+1]=min(A)

print(dp[N-1])
### BUGGY CODE ###

import collections
N,K = map(int,input().split(" "))
A = list(map(int,input().split(" ")))
count = collections.Counter(A)
if len(count.values()) <= K:
    print(0)
else:
    ans = 0
    for i in range(len(count.values()) - K):
        ans += count.most_common()[-(i+1)][1]
    print(ans)


### FIXED CODE ###

import collections
N,K = map(int,input().split(" "))
A = list(map(int,input().split(" ")))
count = collections.Counter(A)
num = len(count)-K
a = sorted(count.values())
print(sum(a[:num]))
### BUGGY CODE ###

# -*- coding: utf-8 -*-

import sys
import os

N = 50001
lst = [True] * N
lst[0] = False
lst[1] = False
for i in range(4, N // 2 + 1, 2):
    lst[i] = False
for i in range(3, int(N ** 0.5) + 1, 2):
    if lst[i]:
        for j in range(2, N // i + 1):
            index = i * j
            if index < N:
                lst[i * j] = False

for s in sys.stdin:
    n = int(s)
    if n == 0:
        break

    if n % 2 == 1:
        if lst[n - 2]:
            print(1)
        else:
            print(0)
    elif n == 4:
        print(1)
    else:
        counter = 0
        for i in range(1, n // 2 + 1, 2):
            prime0 = i
            prime1 = n - i
            if prime0 <= prime1 and lst[prime0] and lst[prime1]:
                #print(prime0, prime1)
                counter += 1
        print(counter)

### FIXED CODE ###

import sys

N = 50001
lst = [True] * N
lst[0] = False
lst[1] = False
for i in range(2, int(N ** 0.5) + 1):
    if lst[i]:
        for j in range(i * i, N, i):
            lst[j] = False

primes = [i for i in range(1, N) if lst[i]]

for s in sys.stdin:
    n = int(s)
    if n == 0:
        break
    elif n % 2 == 1:
        if lst[n - 2]:
            print(1)
        else:
            print(0)
    elif n == 4:
        print(1)
    else:
        counter = 0
        for prime0 in primes:
            prime1 = n - prime0
            if prime0 <= prime1 and lst[prime1]:
                #print(prime0, prime1)
                counter += 1
        print(counter)
### BUGGY CODE ###

import itertools

n = int(input())

seq = (100,101,102,103,104,105)
exists = False
for l in list(itertools.combinations_with_replacement(seq,n//100)):
    if sum(l) == n:
        print('1')
        exists =True
        break
if not exists:
    print('0')


### FIXED CODE ###

n = int(input())
#n = 417
x=n//100
y=n%100
#print(x)
#print(y)
seq = (1,2,3,4,5)
exists = False

for i in seq:
    sum = 0
    z = y%i
    #print( 'z = ' + str(z))
    if z == 0:
        sum = y//i
        #print(sum)
        #print('a')
    else:
        sum = (y//i) + 1
        #print(sum)
    if sum <= x:
        print('1')
        exists =True
        break

if not exists:
    print('0')
### BUGGY CODE ###

import math
from math import floor
A,B,N = map(int,input().split())
maxi = 0
Npower = 0
diff = 0
S = N
while S/10 >= 1:
    Npower += 1
    S /=10
if Npower >= 8: 
    diff = N-10**7
    for i in range(0,10000000):
        maxi = max(floor((A*i)/B)-A*floor(i/B),maxi,0)
    for i in range(diff,N+1):
        maxi = max(floor((A*i)/B)-A*floor(i/B),maxi,0)
else:
    for i in range(0,N+1):
        maxi = max(floor((A*i)/B)-A*floor(i/B),maxi,0)
print(maxi)

### FIXED CODE ###

import math
from math import floor
A,B,N = map(int,input().split())
def f(x):
  return floor(A*x/B) - A*floor(x/B)
print(f(min(B-1,N)))
### BUGGY CODE ###

import math
A, B, K = map(int, input().split())

if A > K:
    A = A - K
    print(A, end=" ")
    print(B)
    exit(0)

if K > A:
    K = K - A
    A = 0
    if K >= B:
        K = K - B
        B = 0
    if B > K:
        B = B - K
        print(A, end=" ")
        print(B)
        exit(0)
    
    
for i in range(K):
    if A >= 1:
        A -= 1
    elif B >= 1:
        B -= 1
    if A == 0 and B == 0:
        break

print(A, end=" ")
print(B)

### FIXED CODE ###

import math
A, B, K = map(int, input().split())

if A >= K:
    A = A - K
    print(A, end=" ")
    print(B)
    exit(0)

if K > A:
    K = K - A
    A = 0
    if K >= B:
        B = 0
        print(A, end=" ")
        print(B)
        exit(0)
    if B > K:
        B = B - K
        print(A, end=" ")
        print(B)
        exit(0)
### BUGGY CODE ###

from copy import deepcopy

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

counter = 0
while(True):
    b = deepcopy(a)
    undivided = True
    for i,v in enumerate(b):
        if v%2 is 0 and undivided:
            a[i] = v//2
            undivided = False
        else:
            a[i] = v*3
    if undivided:
        break
    else:
        counter += 1
print(counter)

### FIXED CODE ###

#!/usr/bin/env python
N = int(input())
A = [int(i) for i in input().split()]
ans = 0
for a in A:
    while a % 2 != 1:
        ans += 1
        a /= 2
print(ans)