Harryxun/stf_run huggingface dataset:
def neighbor(N, edges):
    neighbor_list = [[] for _ in range(N)]
    for a, b in edges:
        neighbor_list[a-1] += [b-1]
        neighbor_list[b-1] += [a-1]
        
    return neighbor_list

def paint(N, K, nlist, clist, p2c, combi):
    p2c_next = {}
    for parent in p2c:
        for children in p2c[parent]:
            # childrenに対し、Kからparentの塗られている近接の数を引いた数だけ組み合わせを掛ける
            combi *= (K - 1 - len([t for t in nlist[parent - 1] if clist[t - 1]]))
            clist[children - 1] = True #子供の頂点を塗る
        # 次の世代のリスト
            p2c_next.update({children:[gc for gc in nlist[children - 1] if gc != parent]})
            
    return clist, p2c_next, combi

def paint2(K, nlist, now_num, from_num, case_num):
        mod = 1000000007
        
        if now_num == 0:
            can_use_color = K - 1
        else:
            can_use_color = K - 2
            
        for child in nlist[now_num]:
            if child == from_num:
                continue
            else:
                case_num *= can_use_color
                can_use_color -= 1
                case_num %= mod
        
        for child in nlist[now_num]:
            if child == from_num:
                continue
            else:
                case_num = paint2(K, nlist, child, now_num, case_num)
        return case_num%mod
            

if __name__ == '__main__':
    N, K = map(int, input().split())
    edges = [None]*(N-1)
    
    for i in range(N-1):
        edges[i] = list(map(int, input().split()))
    
    nlist = neighbor(N, edges)
    
    print(paint2(K, nlist, 0, -1, K))

### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)

def neighbor(N, edges):
    neighbor_list = [[] for _ in range(N)]
    for a, b in edges:
        neighbor_list[a-1] += [b-1]
        neighbor_list[b-1] += [a-1]
        
    return neighbor_list


def paint(K, nlist, now_num, from_num, case_num):
        mod = 1000000007
        if  from_num == -1:
            can_use_color = K - 1
        else:
            can_use_color = K - 2
        
        if len(nlist[now_num]) - 1 > can_use_color:
            return 0
        
        for child in nlist[now_num]:
            if child == from_num:
                continue
            else:
                case_num *= can_use_color
                can_use_color -= 1
                case_num %= mod
        
        for child in nlist[now_num]:
            if child == from_num:
                continue
            else:
                case_num = paint(K, nlist, child, now_num, case_num)
        return case_num%mod
            

if __name__ == '__main__':
    N, K = map(int, input().split())
    edges = [None]*(N-1)
    
    for i in range(N-1):
        edges[i] = list(map(int, input().split()))
    
    nlist = neighbor(N, edges)


    print(paint(K, nlist, 0, -1, K))
from collections import defaultdict
import numpy as np
S = input()

d = defaultdict(list)
for i, s in enumerate(S):
    d[s].append(i + 1)


ans = (-1, -1)
for _, v in d.items():
    dif = np.diff(v).tolist()
    if 1 in dif:
        i = dif.index(1)
        ans = (v[i], v[i + 1])
        break
    elif 2 in dif:
        i = dif.index(1)
        ans = (v[i], v[i + 1])
        break

print(*ans, sep=" ")


### FIXED CODE ###

from collections import defaultdict
import numpy as np
S = input()

d = defaultdict(list)
for i, s in enumerate(S):
    d[s].append(i + 1)


ans = (-1, -1)
for k, v in d.items():
    dif = np.diff(v).tolist()
    if 1 in dif:
        i = dif.index(1)
        ans = (v[i], v[i + 1])
        break
    elif 2 in dif:
        i = dif.index(2)
        ans = (v[i], v[i + 1])
        break

print(*ans, sep=" ")
n=int(input())
a=list(map(int,input().split()))

sum = 0
for n in range(N-1):
	if a[n]>a[n+1]:
		dif=a[n]-a[n+1]
		a[n+1]=a[n+1]+dif
		sum=sum+dif
print(sum)
		

### FIXED CODE ###

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

sum = 0
for n in range(N-1):
	if a[n]>a[n+1]:
		dif=a[n]-a[n+1]
		a[n+1]=a[n+1]+dif
		sum=sum+dif
print(sum)
import fractions


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


N = int(input())
clock = [0]*N
gcd = int(input())
clock[0] = gcd
ans = clock[0]
for i in range(1, N):
    clock[i] = int(input())
    gcd = GCD(ans, clock[i])
    ans /= gcd
    ans *= clock[i]

print(int(ans))


### FIXED CODE ###

import fractions


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


N = int(input())
clock = [0] * N
for j in range(N):
    clock[j] = int(input())
gcd = clock[0]

ans = clock[0]
for i in range(1, N):
    gcd = GCD(ans, clock[i])
    ans = ans//gcd
    ans = ans * clock[i]

print(int(ans))
import sys
def input(): return sys.stdin.readline().rstrip()

def main():
    N = int(input())
    ab = [map(int, input().split()) for _ in range(N-1)]

    graph = [set() for _ in range(N)]
    for a, b in ab:
        graph[a].add(b)

    ans = [-1] * (N-1)
    def dfs(i, color):
        if i == N:
            return
        ans[i-1] = color

        c = 1
        for g in graph[i]:
            if c == color:
                c += 1
            dfs(g, c)
            c += 1

    dfs(1, 1)
    print(max(ans))
    print("\n".join(map(str, ans)))

if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
from collections import deque
def input(): return sys.stdin.readline().rstrip()

def main():
    N = int(input())
    ab = [tuple(map(int, input().split())) for _ in range(N-1)]

    graph = [set() for _ in range(N+1)]
    for a, b in ab:
        graph[a].add(b)
        graph[b].add(a)

    d = deque()
    d.append(1)

    ans = [-1] * (N+1)

    parent = [-1] * (N+1)
    parent[1] = 1

    while d:
        p = d.popleft()
        c = 0
        for g in graph[p]:
            if parent[g] > 0 or g == parent[g]:
                continue
            c += 1
            if c == ans[p]:
                c += 1
            ans[g] = c

            parent[g] = p
            d.append(g)

    print(max(ans))
    for _, b in ab:
        print(ans[b])

if __name__ == '__main__':
    main()
N = int(input())
H = list(map(int, input().split()))
H[0] -= 1
for i in range(N - 1):
    if H[i] < H[i+1] :
        h[i+1] -= 1

    elif H[i] > H[i+1]:
        print('No')
        exit()

print('Yes')


### FIXED CODE ###

N = int(input())
H = list(map(int, input().split()))
H[0] -= 1
for i in range(N - 1):
    if H[i] < H[i+1] :
        H[i+1] -= 1

    elif H[i] > H[i+1]:
        print('No')
        exit()

print('Yes')
i = 1

x=int(input())
if x==0:
 break
print("case {0} : {1}" format(i,x))
i=+1

### FIXED CODE ###

i = 1

while True:

 x=int(input())
 if x==0:
  break
 print("Case {0}: {1}".format(i,x))
 i+=1
from math import sqrt
l = [-1]+[0]*10**4
n = int(input())
for i in range(1,int(sqrt(n))+1):
    for j in range(1,int(sqrt(n))+1):
        for k in range(1,int(sqrt(n))+1):
            l[i**2+j**2+k**2+i*j+j*k+k*i] += 1
for i in range(1,n+1):
    print(l[i])

### FIXED CODE ###

from math import sqrt
l = [-1]+[0]*10**4
n = int(input())
for i in range(1,int(sqrt(n))+2):
    for j in range(1,int(sqrt(n))+2):
        for k in range(1,int(sqrt(n))+2):
            ans = i**2+j**2+k**2+i*j+j*k+k*i
            if ans <= 10**4:
                l[ans] += 1
for i in range(1,n+1):
    print(l[i])
t=input()
if(t=="ABC"){
	print("ARC")}
else{
	print("ABC")}

### FIXED CODE ###

t=input()
if(t=="ABC"):
  print("ARC")
else:
  print("ABC")
A = str(input())
B = str(input())
C = str(input())
X="a"
while True:
    if X == "a":
        X = A[0]
        A.pop(0)
        if len(A) == 0:
            print("A")
            break
    elif X == b:
        X = B[0]
        B.pop(0)
        if len(B) == 0:
            print("B")
            break
    else:
        X = C[0]
        C.pop(0)
        if len(C) == 0:
            print("C")
            break

### FIXED CODE ###

A = list(str(input()))
B = list(str(input()))
C = list(str(input()))
X="a"
while True:
    if X == "a":
        if len(A) == 0:
            print("A")
            break
        X = A[0]
        A.pop(0)
    elif X == "b":
        if len(B) == 0:
            print("B")
            break
        X = B[0]
        B.pop(0)
    else:
        if len(C) == 0:
            print("C")
            break
        X = C[0]
        C.pop(0)
#a,b = map(int,input().split())
s = str(input())
S =['SUN','MON','TUE','WEB','THU','FRI','SAT']
print(7-S.index(s))


### FIXED CODE ###

#a,b = map(int,input().split())
s = input()
S = ['SUN','MON','TUE','WED','THU','FRI','SAT']
print(7-S.index(s))
S = input()

n = len(S)//2
i = 0
T = "True"

while i<=n:
    if S[i] is not "L" and S[i+1] is not "R":
        i = i + 2
    else:
        print("No")
        T = "False"
        break

if T == "True":
    print("Yes")
else:
    pass


### FIXED CODE ###

ss = input()
count = 0
ans  = 0
for s in ss:
    if count%2 == 0 and s != "L":
        pass
    elif count%2 == 0:
        ans += 1
    elif count%2 == 1 and s != "R":
        pass
    elif count%2 == 1:
        ans += 1
    count += 1
if ans == 0:
    print("Yes")
else:
    print("No")
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

sum_A = [0]
for i,a in enumerate(A, 1):
    tmp = sum_A[i-1] + a
    if tmp <= K:
        sum_A.append(tmp)
        mark_A = i
    else:
        break
    
sum_B = [0]
for i,b in enumerate(B, 1):
    tmp = sum_B[i-1] + b
    if tmp <= K:
        sum_B.append(tmp)
        mark_B = i
    else:
        break
    
ans = 0
    
for i,a in enumerate(sum_A):
    for j in range(mark_B, -1, -1):
        if a + sum_B[j] <= K:
            ans = max(ans, i+j)
            break
            
print(ans)

### FIXED CODE ###

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

sum_A = [0]
for i,a in enumerate(A, 1):
    tmp = sum_A[i-1] + a
    if tmp <= K:
        sum_A.append(tmp)
        mark_A = i
    else:
        break
    
sum_B = [0]
for i,b in enumerate(B, 1):
    tmp = sum_B[i-1] + b
    if tmp <= K:
        sum_B.append(tmp)
        mark_B = i
    else:
        break
    
ans = 0
j = len(sum_B) - 1

for i,a in enumerate(sum_A):
    while sum_B[j] > K - a:
        j -= 1
        
    ans = max(ans, i+j)
    
print(ans)
array = [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]
k = int(input())
print(str(array[k + 1]))

### FIXED CODE ###

array = [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]
k = int(input())
print(str(array[k - 1]))
while 1:
    m=input().split()
    h=int(m[0])
    w=int(m[1])
    if a==0 & b==0:
      break
    for i in range(h):
       for j in range(w):
         print("#"*w)
      print(" ")
    print(" ")
    
    


### FIXED CODE ###

while True:
    v=input().split()
    a=int(v[0])
    b=int(v[1])
    if a==0 and b==0:
       break
    for i in range (a):
        print('#'*b)
    print()
print('N')
x=int(input())
x=1000-x%1000
if(x==1000):
    x=0
return(x)

### FIXED CODE ###

x=int(input())
x=1000-x%1000
if(x==1000):
    x=0
print(x)
N, M = map(int, input().split())
A = list(map(int, input().split()))
check = ((1 / (4 * M)) * sum(A))
x = 0
for item in A:
    if item < check:
        x += 1
ans = N - x
if ans >= M :
    print('Yes')
else:
    print('No')N, M = map(int, input().split())
A = list(map(int, input().split()))
check = ((1 / (4 * M)) * sum(A))
x = 0
for item in A:
    if item < check:
        x += 1
ans = N - x
if ans >= M :
    print('Yes')
else:
    print('No')

### FIXED CODE ###

N, M = map(int, input().split())
A = list(map(int, input().split()))
check = ((1 / (4 * M)) * sum(A))
x = 0
for item in A:
    if item < check:
        x += 1
ans = N - x
if ans >= M :
    print('Yes')
else:
    print('No')
num_n = raw_input()
ele_n = raw_input()
num_m = raw_input()
ele_m = raw_input()
  
n = int(ele_n.split())
m = int(ele_m.split())
 
def solve(i, t):
   if t == 0:
      return True
   if i >= num_n:
      return False
   res = solve(i + 1, t) or solve(i + 1,t - n[i])
   return res
 
for t in m:
   if solve(0, t):
      print "yes"
   else:
      print "no"

### FIXED CODE ###

_ = int(input())
hoge = [int(x) for x in input().split()]
_ = int(input())

def exSearch(i, m):
    if m == 0:
        return True
    if i >= len(hoge) or m > sum(hoge):
        return False
    res = exSearch(i+1, m) or exSearch(i+1, m-hoge[i])
    return res

if __name__ == '__main__':
    
    for val in (int(x) for x in input().split()):
        if exSearch(0, val):
            print ('yes')
        else:
            print ('no')
a = int(input())
b = int(input())
 
if (a != 3 and b != 3):
  print(str(3))
elif (a != 2 and B != 2):
  print(str(2))
else:
  print(str(1))

### FIXED CODE ###

a = int(input())
b = int(input())
 
if (a != 1 and b != 1):
  print(1)
elif (a != 2 and b != 2):
  print(2)
else:
  print(3)
a = int(input())
for i in range(1, a + 1):
  if len(str(i)) % 2 ==1: ans+=1   
print(ans)


### FIXED CODE ###

a = int(input())
ans = 0
for i in range(1, a + 1):
  if len(str(i)) % 2 ==1: ans+=1   
print(ans)
k = input()
n = input()
price = list(input().split()).sort

total = sum(prices[:n])
print(total)

### FIXED CODE ###

k, n = map(int, input().split())
prices = list(map(int, input().split()))
prices.sort()
total = sum(prices[:n])
print(total)
N=int(input())
A=list(map(int,input().split()))
B=A.copy()
counter=0
for num in range(N-2):
  if A[num] in B:
    counter+=1
    while A[num] in B:
      B.remove(A[num])
  
print(counter)

### FIXED CODE ###

N=int(input())
z=[]
for num in range(101):
  z.append(0)
counter=0
while counter < N:
  d=int(input())
  z[d]=1
  counter+=1
result=sum(z)
print(result)
X=input()

if x>=30:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

x=int(input())

if x>=30:
  print('Yes')
else:
  print('No')
count = input()
a = 0
b = 0
c = 0
d = 0
while count:
    val = input()
    if val == 'AC':
        a += 1
    elif val == 'WA':
        b += 1
    elif val == 'TLE':
        c +=1
    elif val == 'RE':
        d+=1

print('AC x ' + str(a))
print('WA x ' + str(b))
print('TLE x ' + str(c))
print('RE x ' + str(d))

### FIXED CODE ###

n = int(raw_input())

t = ['AC', 'WA', 'TLE', 'RE']
d = {}
for _ in xrange(n):
    s = raw_input()
    d[s] = d.get(s, 0) + 1
for k in t:
    print '%s x %d' % (k, d.get(k, 0))
#D問題
mod = 1000000007
S = str(input())
N = len(S)

dp = [[0 for i in range(13)] for j in range(N+1)]
dp[0][0] = 1
for i in range(N):
    if S[i] == "?":
        for j in range(10):
            for k in range(13):
                mod13 = (10*k+j)%13
                dp[i+1][mod13] += dp[i][k]
    else:
        s = int(S[i])
        for k in range(13):
            mod13 = (10*k+j)%13
            dp[i+1][mod13] += dp[i][k]
            
print(dp[N][5]%mod)

### FIXED CODE ###

#D問題
mod = 1000000007
S = str(input())
N = len(S)


dp = [[0 for i in range(13)] for j in range(N+1)]
dp[0][0] = 1
for i,s in enumerate(S):
    if s == "?":
        for j in range(10):
            for k in range(13):
                ind = (10*k+j)%13
                dp[i+1][ind] += dp[i][k]
    else:
        j = int(s)
        for k in range(13):
            ind = (10*k+j)%13
            dp[i+1][ind] += dp[i][k]

    for k in range(13):
        dp[i+1][k]%=mod
            
print(dp[N][5]%mod)
import copy

def set(adjacent,edge):
    for x in edge:
        adjacent[x[0]].append(x[1])
        adjacent[x[1]].append(x[0])

    
def search(goal,path):
    n = path[len(path) - 1]
    if n == goal:
        print(path)
    else:
        for x in adjacent[n]:
            if x not in path:
                path.append(x)
                search(goal, path)
                path.pop()

def search_loop_node(adjacent,start,path,node_loops):
    n = path[len(path)-1]
    for x in adjacent[n]:
        if x == start and len(path) >=2 and path[-2] != start :
            path.append(x)
            node_loops.append(copy.deepcopy(path))
            path.pop()
        elif x not in path:
            path.append(x)
            search_loop_node(adjacent,start, path,node_loops)
            path.pop()

def main():
    #入力
    N, M = [int(i) for i in input().split()]
    edge = []
    for i in range(M):
        a,b = [int(i) for i in input().split()]
        edge.append([a,b])

    #辺の生成
    adjacent=[ [] for i in range(N+1)]
    loops=[]
    set(adjacent,edge)
    #ループの検索
    for i in range(N):
        search_loop_node(adjacent,i,[i],loops)
    #ループに属する辺(橋でない辺)の検索
    not_bridge = []
    for loop in loops:
        pre_node = loop[0]
        for node in loop:
            if pre_node < node and [pre_node, node] not in not_bridge:
                not_bridge.append([pre_node,node])
            pre_node = node
    #答えは全体の辺の数からループでないものを引いた数
    print(M-len(not_bridge))
    
if __name__ == '__main__':
    main()

### FIXED CODE ###

A,B,C = [int(i) for i in input().split()]

if(A==B):
    print(C)
elif(A==C):
    print(B)
else :
    print(A)
# -*- coding: utf-8 -*-

def io_generator():
	return input()

#+++++++++++++++++++

def main(io):
	n,q=map(int, io().split())
	s=list(io())
	
	ss=[0 for _ in s[:-1]]
	for i, (c, cn) in enumerate(zip(s, s[1:])):
		if c=='A' and cn=='C':
			ss[i]=1
	
	#ret=[]
	for i in range(q):
		r,l=map(int, io().split())
		rr=sum(ss[r-1:l])-ss[l-1]
		#ret.append(str(rr))
		print(rr)
		
	#return "\n".join(ret)
	
	
#++++++++++++++++++++

if __name__ == "__main__":
	io= lambda : io_generator()
	#print (main(io))
	main(io)

### FIXED CODE ###

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

def io_generator():
	return input()

#+++++++++++++++++++

def main(io):
	n,q=map(int, io().split())
	s=list(io())
	
	ss=[0 for _ in s]
	sss=ss.copy()
	for i, c in enumerate(s[1:],1):
		if s[i-1]=='A' and s[i]=='C':
			ss[i]=1
		sss[i] = ss[i] + sss[i-1]
	
	for i in range(q):
		r, l=map(int, io().split())
		#rr=sum(ss[r-1:l])-ss[l-1]
		rr=sss[l-1]-sss[r-1]
		#ret.append(str(rr))
		print(rr)
	
#++++++++++++++++++++

if __name__ == "__main__":
	io= lambda : io_generator()
	#print (main(io))
	main(io)
N=int(input())
A=input().split()
numbers=[int(a) for a in A]
numbers.sort()
kazu=N//2
b=0
n=N-1
list=[]
nlist=[]
if N==1:
    if A==0:
        print(1)
    else:
        print(0)
else:
    if N % 2 == 0:
        for c in range(kazu):
            list.append(n - c * 2)
        nlist = list + list
        nlist.sort()
        if numbers == nlist:
            print((2 ** kazu)%(10**9+7))
        else:
            print(0)
    else:
        for c in range(kazu):
            list.append(n - c * 2)
        nlist = list + list + [0]
        nlist.sort()
        if numbers == nlist:
            print((2 ** kazu)%(10**9+7))
        else:
            print(0)


### FIXED CODE ###

A,op,B=input().split()
if op=='+':
    print(int(A)+int(B))
else:
    print(int(A)-int(B))
N,K = map(int, input().split())

def replace(x):
    newx = abs(x-K)
    if newx < K/2:
        print(newx)
    else:
        replace(newx)

replace(N)

### FIXED CODE ###

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

print(min([N%K, abs(K-N%K)]))
n = int(raw_input())
his = map(int, raw_input().split(' '))
j,pv,count = 0, +float('inf'),0
while(j < len(his)):
	if pv >= his[j]:
		count +=1
	else:
		count = 1
	m = max(count,m)
	pv = his[j]
	j +=1
print m


### FIXED CODE ###

n = int(raw_input())
his = map(int, raw_input().split(' '))
j = 0
pv = float('inf')
count = 0
m = 0
while(j < len(his)):
	if pv >= his[j]: count +=1
	else: count = 1
	m = max(count-1,m)
	pv = his[j]
	j +=1
print m
iroha = input()
iroha = iroha.split(" ")
iroha = sorted(iroha)
if iroha = ["5", "5", "7"]:
  print("YES")
else:
  print("NO")

### FIXED CODE ###

iroha = input()
iroha = iroha.split(" ")
iroha = sorted(iroha)
if iroha == ["5", "5", "7"]:
  print("YES")
else:
  print("NO")
a = map(int, input())
b = map(int, input())
c = map(int, input())
d = map(int, input())
e = map(int, input())
k = map(int, input())
if e - a =< k:
  print("Yay!")
else:
  print(":(")

### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
if e - a <= k:
  print("Yay!")
else:
  print(":(")
if len(set([int(x) for x in input().split("")])) = 2:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

lst = [int(i) for i in input().split(" ")]

if len(set(lst)) == 2:
  print("Yes")
else:
  print("No")
n = int(input())
a = map(int, input().split())
print(sum(x-1 for x in s))

### FIXED CODE ###

n = int(input())
a = map(int, input().split())
print(sum(x-1 for x in a))
int( input())
k = int( input())
 
a = 1
for i in range(n):
  a = min(a+k, a*2)  
print(a)

### FIXED CODE ###

n = int( input())
k = int( input())

a = [1]
b = [1]
x = 10**6
for i in range(n+1):
  for j in range(n-i,n-i+1):
    f = 1*2**i+j*k
    if x > f:
      x = f
      
print(x)
N = int(input())
H = list(map(int,input().split()))
maxi = 0
cnt = 0
for i in range( N ) :
    if H[i] >= maxi :
        cnt += 1
        maxi = H[i]
print( cnt )
    


### FIXED CODE ###

A,B = map(int,input().split())
if A > B :
    print( 2*A - 1 )
elif A == B :
    print( A + B )
else :
    print( 2*B - 1 )
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

# 全部Aから選んでみる
minutes_a = 0
count_a = 0
for i in range(N):
    if minutes_a + A[i] > K:
        break
    minutes_a += A[i]
    count_a += 1

max_count = count_a
minutes_b = 0
count_b = 0

while count_a > 0:
    for i in range(count_b, M):
        if minutes_a - A[count_a - 1] + minutes_b + B[i] > K:
            break
        minutes_a -= A[count_a - 1]
        count_a -= 1
        minutes_b += B[i]
        count_b += 1

for i in range(count_b, M):
    if minutes_a + minutes_b + B[i] > K:
        minutes_b += B[i]
        count_b += 1


print(count_a + count_b)


### FIXED CODE ###

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

# 全部Aから選んでみる
minutes_a = 0
count_a = 0
for i in range(N):
    if minutes_a + A[i] > K:
        break
    minutes_a += A[i]
    count_a += 1

ans = count_a
minutes_b = 0
count_b = 0

for i in range(M):
    if minutes_a + minutes_b + B[i] > K:
        found = False
        while count_a > 0:
            minutes_a -= A[count_a - 1]
            count_a -= 1
            if minutes_a + minutes_b + B[i] <= K:
                minutes_b += B[i]
                count_b += 1
                found = True
                break
        if not found:
            break
    else:
        minutes_b += B[i]
        count_b += 1
    ans = max(ans, count_a + count_b)

print(ans)
n = input()
s = n % 60
m =((n % 3600) - s) / 60
int(h) = n / 3600
print '%d:%d:%d' % (h, m, s)

### FIXED CODE ###

n = input()
s = n % 60
m =((n % 3600) - s) / 60
h = n / 3600
print '%d:%d:%d' % (h, m, s)
def resolve():
    li = input().split()
    A = int(li[0])
    B = int(li[1].replace('.',''))
    ans = int(A*B/100)
    print(ans)
resolve()

### FIXED CODE ###

def resolve():
    N = int(input())
    def factorization(n):
        arr = []
        temp = n
        for i in range(2, int(-(-n**0.5//1))+1):
            if temp%i==0:
                cnt=0
                while temp%i==0:
                    cnt+=1
                    temp //= i
                arr.append([i, cnt])
        if temp!=1:
            arr.append([temp, 1])
        if arr==[]:
            arr.append([n, 1])
        return arr

    arr = factorization(N)
    ans = 0
    
    for i in range(len(arr)):
        for j in range(1,100):
            if arr[i][0] == 1:
                break
            elif arr[i][1] == 1:
                ans += 1
                break
            elif arr[i][1] == sum(range(0,j+1)):
                ans += j
                break
            elif arr[i][1] < sum(range(0,j+1)):
                ans += j-1
                break
    
    print(ans)
resolve()