Harryxun/stf_run huggingface dataset:
if N == 2:
    if A[1] == 2:
        print(sum(B)+sum(C))
    else:
        print(sum(B))
else:
    k = A[-1]
    if k == A[N-1]:
        print(sum(B)+sum(C))
    else:
        print(sum(B)+sum(C)-C[k-1])

### FIXED CODE ###

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

ans = 0
for i in range(N):
    k = A[i]
    ans += B[k-1]
    if i < N-1:
        if A[i+1] == k+1 and k != N:
            ans += C[k-1]
        else:
            pass
    else:
        pass
print(ans)
S = input()
if S[2] = S[3] and S[4] = S[5]:
  print(Yes)
else if:
  print(No)


### FIXED CODE ###

S = input()
if S[2] == S[3] and S[4] == S[5]:
  print('Yes')
else:
  print('No')
n = int(input())
x = list(range(n))
y = list(range(n))
h = list(range(n))

for i in range(n):
  x[i], y[i], h[i] = map(int, input().split())

flag=0
i = 0
while(flag==0 and i < 101):
  j = 0
  while(flag==0 and j < 101):
    for k in range(n):
      if k == 0:
        ans_h = abs(i-x[k])+abs(j-y[k])+h[k]
      elif abs(i-x[k])+abs(j-y[k])+h[k] != ans_h:
        break
      if k == n-1:
        ans_x = i
        ans_y = j
        flag=1
        break
    j+=1
  i+=1

print(ans_x, ans_y, ans_h)

### FIXED CODE ###

n = int(input())
x = list(range(n))
y = list(range(n))
h = list(range(n))

for i in range(n):
  x[i], y[i], h[i] = map(int, input().split())
  if h[i] != 0:
    X = x[i]
    Y = y[i]
    H = h[i]

flag=0
i = 0
while(flag==0 and i < 101):
  j = 0
  while(flag==0 and j < 101):
    ans_h = abs(i-X)+abs(j-Y)+H
    for k in range(n):
      h_ = max(ans_h-abs(i-x[k])-abs(j-y[k]), 0)
      if h_ != h[k]:
        break
      if k == n-1:
        ans_x = i
        ans_y = j
        flag=1
        break
    j+=1
  i+=1

print(ans_x, ans_y, ans_h)
N=input()
A=(input()).split()
A.sort()

for i in range(N-1):
  if A[i]==A[i+1]:
    print('NO')
  if i==N-2:
    print('YES')
    
	

### FIXED CODE ###

N=(int)(input())
A=(input()).split()
A.sort()
 
for i in range(N-1):
    if A[i]==A[i+1]:
        print('NO')
        break
    elif i==N-2:
        print('YES')
def resolve():
    n = int(input())
    l = list(map(int, input().split()))
    c = collections.Counter(l)
    keys = c.keys()
    key_combinations = set(itertools.combinations(keys, 3))

    result = 0
    for combination in key_combinations:
        max_key = max(combination)
        if sum(combination) - max_key > max_key:
            # 三角形になる
            one_combination_result = 1
            for key in combination:
                one_combination_result = one_combination_result * c[key]
            result += one_combination_result
    print(result)
resolve()

### FIXED CODE ###

import collections
import itertools
def resolve():
    n = int(input())
    l = list(map(int, input().split()))
    c = collections.Counter(l)
    keys = c.keys()
    key_combinations = set(itertools.combinations(keys, 3))

    result = 0
    for combination in key_combinations:
        max_key = max(combination)
        if sum(combination) - max_key > max_key:
            # 三角形になる
            one_combination_result = 1
            for key in combination:
                one_combination_result = one_combination_result * c[key]
            result += one_combination_result
    print(result)
resolve()
import numpy as np
import os

def bcount(C):
    u, counts = np.unique(C, return_counts=True)
    return counts[0]


def main():
    H, W, K = map(int,input().split())
    C = []
    form1 = '0'+str(W)+'b'
    form2 = '0'+str(H)+'b'
    h2 = [str(format(i, form2)).split('b')[0] for i in range(2**H)]
    w2 = [str(format(i, form1)).split('b')[0] for i in range(2**W)]
    default_count = 0
    black_count = 0
    for i in range(H):
        C.append(list(map(str, list(input()))))
        default_count += C[i].count("#")
    print(default_count)
    
    if default_count == K:
        print(1)
        os._exit(1)
    elif default_count < K:
        print(0)
        os._exit(1)
    C = np.array(C,dtype = str)

    for i in range(len(h2)):
        co = np.copy(C)
        tmp = list(h2[i])
        for j in range(len(tmp)):
            if(tmp[j] == '1'):
                co[j,:] = "%"
        for k in range(len(w2)):
            co2 = np.copy(co)
            tmp = list(w2[k])
            for j in range(len(tmp)):
                if(tmp[j] == '1'):
                    co2[:,j] = "%"
            if (bcount(co2) == K):
                black_count += 1

    print(black_count)

if __name__ == "__main__":
    main()

### FIXED CODE ###


import numpy as np

H, W, K = map(int,input().split())
D = np.zeros([H,W])

black_count = 0
for i in range(H):
    C = list(input())
    for j in range(len(C)):
        if(C[j] == "#"):
            D[i][j] = 1


#print(D)
for i in range(2**H):
    h = format(i, '06b')
    for j in range(2**W):
        w = format(j, '06b')
        d = D.copy()

        for hi in range(H):
            if(h[5-hi] == '1'):
                d[hi,:]=0
        for wi in range(W):
            if(w[5-wi] == '1'):
                d[:,wi]=0
            
        if (d.sum() == K):
            black_count += 1

print(black_count)
N = int(input())
ans = []
M = n + 1 * (N % 2 == 0)
for i in range(1, n + 1):
    for j in range(i + 1, n + 1):
        if i + j == M:
            continue
        ans.append('{} {}'.format(i, j))
print(len(ans))
print('\n'.join(ans))

### FIXED CODE ###

N = int(input())
ans = []
lis = []
for i in range(N):
    lis.append(i + 1)
if N % 2 == 0:
    M = (N - 2) * N // 2
    for i in range(1, N):
        for j in range(1, N):
            if j != i and i != lis[-j]:
                if sorted([i, lis[-j]]) not in ans:
                    ans.append(sorted([i, lis[-j]]))
    print(M)
    for i in range(M):
        print(' '.join(map(str, ans[i])))
else:
    M = (N - 1) ** 2 // 2
    for i in range(1, N):
        for j in range(2, N):
            if j != i + 1 and i != lis[-j]:
                if sorted([i, lis[-j]]) not in ans:
                    ans.append([i, lis[-j]])
    for i in range(1, N):
        ans.append([N, i])
    print(M)
    for i in range(M):
        print(' '.join(map(str, ans[i])))
def main():
  if 'get_ipython' not in globals():  
    # For Subsession
    N,K = map(int, input().split())
    h = []
    for _ in range(N):
      h.append(int(input()))
  else:
    # N = 5
    # K = 3
    # h = [10,15,11,14,12]
    N = 5
    K = 3
    h = [5,7,5,7,7]

  h.sort()
  for i in range(0,len(h)-2):
    if i == 0:
      ans = 0
      for n in range(0,K-1):
        ans += (h[n+1] - h[n])
    else:
      tmp = 0
      for n in range(i, i+K-1):
        tmp += (h[n+1] - h[n])
      if ans > tmp:
        ans = tmp
  
  print(ans)

main()

### FIXED CODE ###

import sys
def main():
  if 'get_ipython' not in globals():  
    # For Subsession
    N,K = map(int, input().split())
    h = []
    for _ in range(N):
      h.append(int(input()))
  else:
    N = 5
    K = 3
    h = [10,15,11,14,12]
    # N = 5
    # K = 3
    # h = [5,7,5,7,7]

  h.sort()  

  ans = (h[K-1] - h[0])
  
  max_i = len(h)-K+1
  for i in range(1,max_i):
    tmp = (h[i+K-1] - h[i])
    if ans > tmp:
      ans = tmp
    if ans == 0:
      print(ans)
      sys.exit()
  
  print(ans)

main()
s = input()
dp = [[0 for i in range(13)] for i in range(len(s))]
if s[-1] != "?":
    dp[0][int(s[-1]) % 13] += 1
else:
    for k in range(10):
        dp[0][k % 13] += 1

for i in range(1,len(s)):
    for r in range(13):
        if s[-(i+1)] == "?":
            for k in range(10): 
                dp[i][(k * (10**i) % 13 + r) % 13] += dp[i-1][r]
                
        else:
            dp[i][(int(s[-(i+1)]) * (10**i) % 13 + r) % 13] += dp[i-1][r]
    for r in range(13)    
        dp[i][r]  %= 10**9 + 7
print(dp[len(s)-1][5]%(10**9+7))


### FIXED CODE ###

s = input()
dp = [[0 for i in range(13)]]
if s[-1] != "?":
    dp[0][int(s[-1]) % 13] += 1
else:
    for k in range(10):
        dp[0][k % 13] += 1
        
d = [1]   
for i in range(1,len(s)):
    dp.append([0]*13)
    d.append(d[i-1]*10 % 13)
    for r in range(13):
        if s[-(i+1)] == "?":
            for k in range(10): 
                dp[i][(k * d[i] + r) % 13] += dp[i-1][r] % (10**9 + 7)
                
        else:
            dp[i][(int(s[-(i+1)]) * d[i] + r) % 13] += dp[i-1][r] % (10**9 + 7)

print(dp[len(s)-1][5]%(10**9+7))
n,m,x = map(int, input().split())
result = 10**9
for _ in range(n):
	books=list(map(int, input().split()))
	A = A.append(books[0])
	C = C.append(books[1:])
for i in range(1<<n):
	cnt = 0
	rikaido = [0]*m
	for j in range(n):
		if (i<<j)&1:
			for k in range(m):
				rikaido[k]+=C[j][k]
			cnt += A[j]
		else:
			pass
	if min(rikaido)>=x:
		result = min(result, cnt)
if result == 10*9:
	print(-1)
else:
	print(result)

### FIXED CODE ###

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

C=[]
A=[]
for i in range(n):
	t = list(map(int, input().split()))
	C.append(t[0])#price of books
	A.append(t[1:])#point of books
	
result = 10**9 #結果の初期値
#N冊の本買う/買わない　を総当たり
for i in range(1<<n):#range(0,2**n)と同意
	t = [0] * m #理解度m個
	c = 0 #値段0
	#1-n冊目までをシフト演算
	for j in range(n):
		if (i>>j)&1:#購入している場合
			for k in range(m):
				t[k] += A[j][k]#各理解度をインプット
			c += C[j] #購入した本の値段を足していく
		else:
			pass
	if min(t)>=x:
		result=min(result, c)
if result == 10**9:
	print(-1)
else:
	print(result)
# -*- coding: utf-8 -*-
from math import factorial

n = int(input())
strlist = []
for i in range(n):
    strlist.append(sorted(list(str(input()))))

allcount = 0
while (len(strlist) > 1):
    i = 1
    count = 1
    while True:
        if(strlist[0] == strlist[i]):
            count += 1
            strlist.pop(i)
        else:
            i += 1
        if(i==len(strlist)):
            if(count > 1):
                allcount += int(factorial(count) / factorial(2) / factorial(count-2))
            break
    strlist.pop(0)
print(allcount)

### FIXED CODE ###

n = int(input())
strdict = {}
count = 0
for i in range(n):
    sortedstr = "".join(sorted(str(input())))
    strdict.setdefault(sortedstr, 0)
    count += strdict[sortedstr]
    strdict[sortedstr] += 1
print(count)
def ok(m,e):
    for x in range(m+1):
        for y in range(m+1-x):
            z = m-x-y
            if z < 0: break
            if x + y**2 + z**3 == e: return True
    return False

while True:
    E = int(input())
    if E == 0: break
    m = 1
    while not ok(m,E):
        m += 1
    print(m)

### FIXED CODE ###

import math
while True:
    E = int(input())
    if E == 0: break
    ans = 10**10
    z = 0
    while z**3 <= E:
        y = int(math.sqrt(E - z**3))
        x = E - z**3 - y**2
        ans = min(x+y+z, ans)
        z += 1
    print(ans)
def out(m, n):
  a = m*(m-1)%2 + n*(n-1)%2
  return a

m, n = list(input())
a = out(m,n)

print(a)

### FIXED CODE ###

n, m = map(int, input().split())
a = n*(n-1)/2 + m*(m-1)/2
print(int(a))
n, m = map(int, input().split())
s = input()
t = input()

def gcd(x, y):
    while y:
        x, y = y, x % y
    return x

def lcm(x, y):
    return x * y // gcd(x, y)

L = lcm(n, m)
target = [0] * L
for i in range(n):
    target[i * L // n] = s[i]
for i in range(m):
    if target[i * L // m] == 0 or target[i * L // m] == t[i]:
        target[i * L // m] = t[i]
    else:
        print('-1')
        exit()

print(L)

### FIXED CODE ###

n, m = map(int, input().split())
s = input()
t = input()

def gcd(x, y):
    while y:
        x, y = y, x % y
    return x

def lcm(x, y):
    return x // gcd(x, y) * y

g = gcd(n, m)
bl = True
for k in range(g):
    i, j = k * n // g, k * m // g
    if s[i] != t[j]: # s[i] != s[j] にしてた...
        bl = False

print(lcm(n, m)) if bl else print('-1')
#!/usr/bin/env python3
#ABC138 E

import sys
import math
import bisect
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

s = input()
t = input()
n = len(s)
m = len(t)
f = [False]*26
f2 = [False]*26
alpha = 'abcdefghijklmnopqrstuvwxyz'
for i in range(n):
    f[alpha.index(s[i])] = True
for i in range(m):
    f2[alpha.index(t[i])] = True
for i in range(26):
    if not f[i] and f2[i]:
        print(-1)
        quit()
x = []
inde = s.index(t[0])
x.append(inde+1)
if m > 1:
    x.append(n-inde-1)
for i in range(1,m):
    inde = s.index(t[i])
    preinde = s[i:].index(t[i])
    if inde > preinde:
        x.pop()
        x.append(inde-preinde)
        if i != m-1:
            x.append(n-inde-1)
    else:
        x.append(inde+1)
        if i != m-1:
            x.append(n-inde-1)
print(sum(x))


### FIXED CODE ###

#!/usr/bin/env python3
#ABC138 E

import sys
import math
import bisect
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

s = input()
t = input()
n = len(s)
m = len(t)
f = [False]*26
f2 = [False]*26
alpha = 'abcdefghijklmnopqrstuvwxyz'
for i in range(n):
    f[alpha.index(s[i])] = True
for i in range(m):
    f2[alpha.index(t[i])] = True
for i in range(26):
    if not f[i] and f2[i]:
        print(-1)
        quit()
ans = 0
pre = s.index(t[0])
ans += pre+1
for i in range(1,m):
    s = s[pre+1:] + s[:pre+1]
    inde = s.index(t[i])
    ans += inde+1
    pre = inde
print(ans)
import collections
q = collections.deque()

n = int(input())
for i in range(n):
    com = input().split()
    if com[0] == 'insert':
        q.appendleft(int(com[1]))
    elif com[0] == 'delete':
        q.remove(int(com[1]))
    elif com[0] == 'deleteFirst':
        q.popleft()
    elif com[0] == 'deleteLast':
        q.pop()
print(' '.join(q))

### FIXED CODE ###

import collections
q = collections.deque()
n = int(input())
for i in range(n):
    com = input().split()
    if com[0] == 'insert':
        q.appendleft(int(com[1]))
    elif com[0] == 'delete':
        try:
            q.remove(int(com[1]))
        except:
            pass
    elif com[0] == 'deleteFirst':
        q.popleft()
    elif com[0] == 'deleteLast':
        q.pop()
print(*q)
# Python3 program to insert 
# an element into sorted list 
import bisect 

def insert(list, n): 
	bisect.insort(list, n) 
	return list



n=int(input())
l=[]
q=[]
w=[]
S=[]
D=[]
for i in range(0,n):
    o=int(input())
    l.append(o)
G=0;
for i in range(0,len(l)-1):
    if l[i] <= l[i+1]:
        G=1;
        break;
if G==0:
    print(len(l))
else:
    for i in range(0,len(l)):
        o=l[i]
        if i==0:
            q.append(o)
        else:
            V=-1;
            G=0;
            I=0;
            J=len(q)-1;
            while(I<=J):
                m=(I+J)//2;
                if q[m] < o:
                    V=m;
                    I=m+1;
                else:
                    if q[m]>=o:
                        J=m-1;
            if V==-1:
                q=insert(q,o);
            else:
                q[V]=o;
    print(len(q))

### FIXED CODE ###

n=int(input())
print(3*(n**2))
import sys
sys.setrecursionlimit(10000000)

N, A, B, K = map(int, input().split())
mod = 998244353

def pow(n, i):
    if i == 0: return 1
    elif i == 1: return n
    elif i % 2 == 0: return pow((n * n) % mod, i//2)
    else: return (pow((n * n) % mod, i//2) * n) % mod

factorial = [1] *(N+1)
revfactorial = [1] * (N+1)
for i in range(N):
    factorial[i+1] = (factorial[i] * (i+1)) % mod
revfactorial[N] = pow(factorial[N], mod-2)
for i in reversed(range(1, N)):
    revfactorial[i] = (revfactorial[i+1] * (i+1)) % mod

ans = 0
for a in range(N+1):
    if K >= A * a:
        if (K - A * a) % B == 0:
            b = (K - A * a) // B
            apatt = (factorial[N] * revfactorial[N - a] * revfactorial[a]) % mod
            bpatt = (factorial[N] * revfactorial[N - b] * revfactorial[b]) % mod
            ans += (apatt * bpatt) % mod
            ans %= mod
print(ans)

### FIXED CODE ###

N, A, B, K = map(int, input().split())
mod = 998244353

def pow(n, i):
    if i == 0: return 1
    elif i == 1: return n
    elif i % 2 == 0: return pow((n * n) % mod, i//2)
    else: return (pow((n * n) % mod, i//2) * n) % mod

factorial = [1] *(N+1)
revfactorial = [1] * (N+1)
for i in range(N):
    factorial[i+1] = (factorial[i] * (i+1)) % mod
revfactorial[N] = pow(factorial[N], mod-2)
for i in reversed(range(1, N)):
    revfactorial[i] = (revfactorial[i+1] * (i+1)) % mod

ans = 0
for a in range(N+1):
    if K >= A * a:
        if (K - A * a) % B == 0:
            b = (K - A * a) // B
            apatt = (factorial[N] * revfactorial[N - a] * revfactorial[a]) % mod
            if b <= N: bpatt = (factorial[N] * revfactorial[N - b] * revfactorial[b]) % mod
            else: bpatt = 0
            ans += (apatt * bpatt) % mod
            ans %= mod
print(ans)
import itertools
from math import factorial

N = int(input())
s = {}
for _ in range(N):
    b = list(input())
    b.sort()
    c = ''.join(b)
    if not c in s:
        s[c] = 1
    else:
        s[c] += 1

a = [factorial(v) / factorial(2) / factorial(v - 2) for v in s.values()]
print(sum(a))

### FIXED CODE ###

import itertools
from math import factorial
from scipy.misc import comb

N = int(input())
s = {}
for _ in range(N):
    b = list(input())
    b.sort()
    c = ''.join(b)
    if not c in s:
        s[c] = 1
    else:
        s[c] += 1

a = [comb(v, 2, exact=True) for v in s.values()]
print(sum(a))
a, b = map(int, input().split())
 print(max(a+b,max(a-b,a*b)))

### FIXED CODE ###

a, b = map(int, input().split())
print(max(a+b,max(a-b,a*b)))
import math

A,B = map(int,input().split())

maxn=math.gcd(A,B)
count=0
list=[]
def isPrime(n):
    if n == 2:
        return True
    if n % 2 == 0:
        return False

    m = math.floor(math.sqrt(n)) + 1
    for p in range(3, m, 2):
        if n % p == 0:
            return False
        return True
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    return divisors

yaku=make_divisors(maxn)
for i in range(len(yaku)):
    if isPrime(yaku[i]):
        list.append(yaku[i])

print(len(list))


### FIXED CODE ###

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

maxn=fractions.gcd(A,B)
list=[]
def isPrime(n):
    if n == 2:
        return True
    if n % 2 == 0:
        return False
    if n==3:
        return True
    m = math.floor(math.sqrt(n)) + 1
    for p in range(3, m,2):
        if n % p == 0:
            return False
    return True
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    return divisors

yaku=make_divisors(maxn)
for i in range(len(yaku)):
    if isPrime(yaku[i]):
        list.append(yaku[i])

print(len(list))
# -*- coding: utf-8 -*-

import sys

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

for line in sys.stdin:
    gcd = 1
    lcm = 1
    a, b = map(int, line.split())
    gcd(a, b)
    lcm = a*b/gcd/gcd
    print "%d %d" %(gcd, lcm)

### FIXED CODE ###

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

import sys

for line in sys.stdin:
    a, b = map(int, line.split())
    t1, t2 = a, b
    while True:
        if a%b:
            a, b = b, a%b
        else:
            break
    gcd = b
    lcm = t1/gcd*t2
    print "%d %d" %(gcd, lcm)
s = input()
k = int(input())
l = []
for i in range(1,k):
    for j in range(len(s)-i+1):
        l.append(s[j:j+i])


l = list(set(l))
l.sort()
print(l[k-1])

### FIXED CODE ###

s = input()
k = int(input())
l = []
for i in range(1,k+1):
    for j in range(len(s)-i+1):
        l.append(s[j:j+i])


l = list(set(l))
l.sort()
print(l[k-1])
N, M, K = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

A = [0]
B = [0]
for i in range(N):
  A.append(A[i] + a[i])
for i in range(M):
  B.append(B[i] + b[i])
  
ans = 0
j = M
for n in range(N + 1):
  while True:
    time = A[n] + B[j]
    if time <= K:
      ans = max(ans, n + j)
      break
    else:
      j -= 1
      if j < 0:
        break
print(ans)


### FIXED CODE ###

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

A = [0]
B = [0]
for i in range(N):
  A.append(A[i] + a[i])
for i in range(M):
  B.append(B[i] + b[i])
  
ans = 0
j = M
for n in range(N + 1):
  if A[n] > K:
    break
  while B[j] > K - A[n]:
      j -= 1
  ans = max(ans, n + j)
print(ans)
N,W=map(int,input().split())
dp=[[0]*(W+1) for i in range(N)]
for i in range(N-1):
  w,v=map(int,input().split())
  for j in range(W+1):
    if j>=w:
      dp[i+1][j]=max(dp[i][j-w]+v,dp[i][j])
    else:
      dp[i+1][j]=dp[i][j]
print(dp[n][W])

### FIXED CODE ###

N,W=map(int,input().split())
dp=[[0]*(W+1) for i in range(N+1)]
for i in range(N):
  w,v=map(int,input().split())
  for j in range(W+1):
    if j>=w:
      dp[i+1][j]=max(dp[i][j-w]+v,dp[i][j])
    else:
      dp[i+1][j]=dp[i][j]
print(dp[N][W])
import sympy

def pop(stack):
	return stack[0],stack[1:]

def push(stack,x):
	stack.append(x)
	s = set(stack)
	p = list(s)
	p.sort()
	return p
	"""
	for i in range(len(stack)):
		#print(type(stack[i]),type(x))
		if stack[i] < x:
			t = stack[:i+1]
			t.append(x)
			g = t + stack[i+1:]
			return g
		if stack[i] == x:
			return stack
	"""

n = int(input())
a = sympy.factorint(n)
#print(type(a))
stack = []
temp = []
for i in a:
	stack.append(i)
	temp.append(i)
#print(stack)
#print(set(stack))
ans = 0
while 1 < n:
	v, stack = pop(stack)
	#print(v,n,n%v,stack)
	#print(type(v))
	#v_a = factorint(v)
	#aとv_aとの比較
	if n%v == 0:
		ans += 1
		n /= v
		if n <= v: break
		for i in temp:
			#print(i*v)
			stack = push(stack,i*v)
	else:
		continue
print(ans)		
		
		



### FIXED CODE ###

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



def pop(stack):
	return stack[0],stack[1:]

def push(stack,x):
	stack.append(x)
	s = set(stack)
	p = list(s)
	p.sort()
	return p

n = int(input())
#a = sympy.factorint(n)
a = factorization(n)
ans = 0
if n != 1:
	for i in a:
		t = 1
		k = 1
		while t <= i[1]:
			#print(t,k,i[1])
			ans += 1
			k += 1
			t += k
			#print(t,k,i[1])
	
print(ans)
N=int(input())
S=list(input())

dp=[[0 for _ in range(i)] for i in range(N)]
#dp[i][j]:i文字目とj文字目からの共通文字の最大長さ(i>j)

for i in range(N-1):
  if S[i]==S[N-1]:
    dp[N-1][i]=1

for i in reversed(range(N-1)):
  for j in range(i):
    if S[i]==S[j]:
      dp[i][j]=dp[i+1][j+1]+1
      if j+dp[i][j]-1>=i:
        dp[i][j]=i-j

A=[]
for i in range(N):
  for j in range(i):
    A.append(dp[i][j])

print(max(A))


### FIXED CODE ###

S=input()
if S=="Sunny":
  print("Cloudy")
elif S=="Cloudy":
  print("Rainy")
elif S=="Rainy":
  print("Sunny")
x,k,d = input().split()
ans = 0
if abs(x) > abs(k*d):
    ans =  abs(x) - abs(k*d)
else:
    kaisuu = abs(x)/d 
    k_2 = k - kaisuu
    if k_2/2 == 2:
        ans = abs(x) - d*kaisuu 
    else:
        ans = (abs(x) - d*kaisuu) - d
print(ans)


### FIXED CODE ###

x,k,d = input().split()
x = int(x)
k = int(k)
d = int(d)
ans = 0
if abs(x) >= abs(k*d):
    ans =  abs(x) - abs(k*d)
else:
    kaisuu = int(abs(x)/d)
    k_2 = k - kaisuu
    if k_2%2 == 0:
        ans = abs(x) - d*kaisuu 
    else:
        ans = abs((abs(x) - d*kaisuu) - abs(d))
print(int(ans))