Harryxun/stf_run huggingface dataset:
from collections import Counter

n = int(input())
a = list(map(int, input().split()))
h = Counter()
for x in a:
    h[x] += 1
f = True
for k, v in h.most_common():
    if n % 2 == 1 and k == 0:
        if v != 1:
            f = False
            break
    elif v != 2:
        f = False
        break
MOD = 1_000_000_007
def mpow(n, p, mod):
    r = 1
    while p > 0:
        if p & 1 == 1:
            r = r * n % mod
        n = n * n % mod
        p >>= 1
    return r
print(mpow(2, int(n / 2), MOD) if f else 0) 

### FIXED CODE ###

from collections import Counter

n = int(input())
a = list(map(int, input().split()))
h = Counter()
for x in a:
    h[x] += 1
f = True
for k, v in h.items():
    if n % 2 == 1 and k == 0:
        if v != 1:
            f = False
            break
    elif v != 2:
        f = False
        break
MOD = 1000000007
def mpow(n, p, mod):
    r = 1
    while p > 0:
        if p & 1 == 1:
            r = r * n % mod
        n = n * n % mod
        p >>= 1
    return r
print(mpow(2, int(n / 2), MOD) if f else 0)
# A - Addition
N = int(input())
k = 0
for i in range(N):
    k = (int(input()) + k) % 2
k *= int(N!=1)
ans = ['YES', 'NO']
print(ans[k])

### FIXED CODE ###

# A - Addition

N = int(input())
A = list(map(int, input().split()))
k = 0
for i in range(N):
    k = (A[i] + k) % 2
k *= int(N!=1)
ans = ['YES', 'NO']
print(ans[k])
N, W = map(int, input().split())
WV = (map(int, input().split()) for _ in range(N))

DP = [0] * (W+1)

for w, v in WV:
  for j in range(W, w-1, -1):
    dp = DP[j-w] + v 
    if DP[j] < dp:
      DP[j] = dp
print(max(DP))


### FIXED CODE ###

import sys
input = sys.stdin.readline

def dp_fn():
  N, W = map(int, input().split())
  WV = (map(int, input().split()) for _ in range(N))
  
  DP = {0:0}
  
  for w, v in WV:
    keys = sorted(DP.keys(), reverse=True)
    for i in keys:
      j = DP[i]
      if j+w <= W:
        if i+v in DP:
          DP[i+v] = min(DP[i+v], j+w)
        else:
          DP[i+v] = j+w
  return max(DP.keys())
  
print(dp_fn())
n,m = [int(i) for i in input().split()]
a = list(map(int,input().split()))

import sys
sys.setrecursionlimit(10000)

match = [0,2,5,5,4,5,6,3,7,6]

dig = [0] * (n+1)

inf = 10**9


for i in range(1,n+1):
    lst = []
    for j in range(len(a)):
        num = a[j]
        mat = match[num]
        bef = i-mat
        if bef >= 0:
            lst.append(dig[bef])
        if lst:
            dig[i] = max(lst) + 1


ans = ""
def dp(i):
    if i == 0:
        return
    global ans
    maxi = 0
    for j in range(len(a)):
        num = a[j]
        mat = match[num]
        bef = i - mat
        if dig[i] == 1:
            if bef == 0:
                maxi = max(maxi,num)
                k = 0
        else:
            if bef >= 0:
                if dig[bef] == dig[i]-1:
                    if num > maxi:
                        maxi = num
                        k = bef
    ans += str(maxi)
    dp(k)

dp(n)
print(ans)

### FIXED CODE ###

n,m = [int(i) for i in input().split()]
a = list(map(int,input().split()))

import sys
sys.setrecursionlimit(50000)

match = [0,2,5,5,4,5,6,3,7,6]

dig = [0] * (n+1)

inf = 10**9


for i in range(1, n + 1):
    lst = []
    for j in range(len(a)):
        num = a[j]
        mat = match[num]
        bef = i - mat
        if bef >= 0:
            if bef == 0:
                lst.append(dig[bef])
            else:
                if dig[bef] > 0:
                    lst.append(dig[bef])
        if lst:
            dig[i] = max(lst) + 1


ans = ""


def dp(i):
    k = -1
    if i == 0:
        return
    global ans
    maxi = 0
    for j in range(len(a)):
        num = a[j]
        mat = match[num]
        bef = i - mat
        if dig[i] == 1:
            if bef == 0:
                maxi = max(maxi, num)
                k = 0
        else:
            if bef >= 0:
                if dig[bef] == dig[i] - 1:
                    if num > maxi:
                        maxi = num
                        k = bef
    ans += str(maxi)
    if k >= 0:
        dp(k)


dp(n)
print(ans)
import sys
sys.setrecursionlimit(10000000)
import math
def lcm(a,b):
    return a*b//math.gcd(a,b)


def div(n,divn):
    #1からnまでの中で、divnで割り切れる数の数を示す
    return n//divn

def divor(n,div1,div2):
    #1からnまでの中で、div1,div2のどちらかで割り切れる数の数を示す
    return div(n,div1)+div(n,div2)-div(n,lcm(div1,div2))
def nondivor(n,div1,div2):
    #１からnまでの中で、div1,div2のどちらでも割り切れない数の数を示す
    return n-divor(n,div1,div2)


a,b,c,d=[int(i) for i in input().split()]


print(nondivor(b,c,d)-nondivor(a-1,c,d))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10000000)

from fractions import gcd
def lcm(a,b):
    return int(a*b/gcd(a,b))


def div(n,divn):
    #1からnまでの中で、divnで割り切れる数の数を示す
    return n//divn

def divor(n,div1,div2):
    #1からnまでの中で、div1,div2のどちらかで割り切れる数の数を示す
    return div(n,div1)+div(n,div2)-div(n,lcm(div1,div2))
def nondivor(n,div1,div2):
    #１からnまでの中で、div1,div2のどちらでも割り切れない数の数を示す
    return n-divor(n,div1,div2)


a,b,c,d=[int(i) for i in input().split()]


print(nondivor(b,c,d)-nondivor(a-1,c,d))
s = list(input())
K = int(input())
alphabet = "abcdefghijklmnopqrstuvwxyz"

for i in range(len(s)):
    if K > 26 or s[i] >= alphabet[-K]:
        K -= ord("z") - ord(s[i]) + 1
        s[i] = "a"

if K > 0:
    K %= 26
    s[-1] = chr(ord(s[-1]) + K)

print("".join(s))

### FIXED CODE ###

s = list(input())
k = int(input())

for i in range(len(s)):
    if s[i] == "a": continue

    diff = ord("z") - ord(s[i]) + 1

    if diff <= k:
        k -= diff
        s[i] = "a"

if k > 0:
    k %= 26
    s[i] = chr(ord(s[i]) + k)

print("".join(s))
S = input()
judge = True
for i in range(len(S)//2 + 2):
    if S[i] != S[len(S) - i - 1]:
        judge = False
        break


if judge:        
    for i in range(int((len(S)-1)/2)):
  
        if S[i] != S[int((len(S)-1)/2)- 1 - i]:
            judge = False
            break
        elif S[int((N+3)/2)-1 + i] != S[N-1-i]:
            judge = False
            break

if judge:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

S = input()
N = len(S)
judge = True
for i in range(len(S)//2):
    if S[i] != S[len(S) - i - 1]:
        judge = False
        break


if judge:        
    for i in range(int((len(S)-1)/2)):
  
        if S[i] != S[int((len(S)-1)/2)- 1 - i]:
            judge = False
            break
        elif S[int((N+3)/2)-1 + i] != S[N-1-i]:
            judge = False
            break

if judge:
    print("Yes")
else:
    print("No")
n = int(input())
H = [int(i) for i in input().split()]
high = H[0]
for i in range(1,n):
    tmp = H[i]-high
    if 0<=tmp<=1:
        pass
    elif tmp = -1:
        high -= 1
    elif tmp > 1:
        high = H[i]
    else:
        print('No')
        exit()
print('Yes')


### FIXED CODE ###

n = int(input())
H = [int(i) for i in input().split()]
high = H[0]
for i in range(1,n):
    tmp = H[i]-high
    if -1<=tmp<=1:
        pass
    elif tmp > 1:
        high = H[i]
    else:
        print('No')
        exit()
print('Yes')
from scipy.sparse.csgraph import dijkstra
n,m,s,t=map(int,input().split())

E=[[10**15 for j in range(n+1)]for i in range(n+1)]
S=[[10**15 for j in range(n+1)]for i in range(n+1)]

for i in range(m):
    x,y,a,b=map(int,input().split())
    E[x][y]=a
    E[y][x]=a
    S[x][y]=b
    S[y][x]=b
    
#print(E)
#print(S)
E=dijkstra(E,indices = s)
S=dijkstra(S,indices = t)
#print(E)
#print(S)

Q=[]
for i in range(1,n+1):
    Q.append((int(E[i]+S[i]),i))

import heapq
heapq.heapify(Q)
for i in range(1,n+1):
    while Q[0][1]<i:
        heapq.heappop(Q)
    print(10**15-Q[0][0])


### FIXED CODE ###

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

en=[[]for i in range(n+1)]
sn=[[]for i in range(n+1)]

for i in range(m):
    u,v,a,b=map(int,input().split())
    en[v].append((u,a))
    en[u].append((v,a))
    sn[v].append((u,b))
    sn[u].append((v,b))
#print(en)

import numpy as np
INF=10**20

def dijkstra(S, N, paths):
    from heapq import heappush,heappop
    q=[(0,S)]
    shortest=[INF]*N
    shortest[S]=0
    while len(q)>0:
        d0, src=heappop(q)
        if d0>shortest[src]:
            continue
        for dst, d1 in paths[src]:
            if d0+d1<shortest[dst]:
                shortest[dst]=d0+d1
                heappush(q, (d0+d1, dst))
    return np.array(shortest)
    
en=dijkstra(s,n+1,en)
sn=dijkstra(t,n+1,sn)

cost=[]
for i in range(1,n+1):
    cost.append(en[i]+sn[i])
cost=cost[::-1]
#print(cost)

ans=[]
mi=cost[0]
for i in range(n):
    ans.append(min(mi,cost[i]))
    mi=min(mi,cost[i])
ans=ans[::-1]
#print(ans)
for i in ans:
    print(10**15-i)
a,b = map(int,input().split())
if a>9 0r b>9:
  print(":(")
else:
  print("yay!")

### FIXED CODE ###

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

if a<9 and b<9:
  print("Yay!")
elif a>8 or b>8:
  print(":(")
import heapq

mnum, gnum = map(int, input().split())
array = list(map(lambda a: -int(a), input().split()))

array.sort()
heapq.heapify(array)

for i in range(gnum):
	temp = heapq.heappop(array)
	temp /= 2.0
	heapq.heappush(array, temp)
    
amount = 0
for a in array:
  amount += math.floor(-a)
print(amount)

### FIXED CODE ###

import math
import heapq

N, M = list(map(int, input().split()))
A = list(map(lambda a: -int(a), input().split()))
A.sort()
heapq.heapify(A)

for i in range(M):
  a = heapq.heappop(A)
  a /= 2.0
  heapq.heappush(A, a)

amount = 0
for a in A:
  amount += math.floor(-a)
print(amount)
# F
import numpy as np
from collections import deque
 
TT_list = []
# input
N, L = map(int, input().split())
T = 0.0
vt_now = 0.0
v_now = 0
que = deque()

for i in range(N):
    ti, v = map(int, input().split())
    t = float(ti)
    v_now += v
    vt_now += v*t
    # add
    if v == L:
        que.deque([t, v])
    else:
        while v < L and len(que) > 0:
            t_, v_ = que[-1]
            if t_ <= t:
                que.append([t, v])
                break
            elif v + v_ > L:
                v_ = v + v_ - L
                t = ((L - v) * t_ + v * t) / L
                v = L
                que = deque([[t, v]])
                v_now = L
                vt_now = t*L
                # break
            else:
                t = (t*v + t_*v_) / (v + v_)
                v = v + v_
                if v == L:
                    que = deque([[t, v]])
                    v_now = L
                    vt_now = t*L
                else:
                    que.pop()
    # minus
    while v_now > L:
        if que[0][1] <= v_now - L:
            v_now -= que[0][1]
            vt_now -= que[0][1]*que[0][0]
            que.popleft()
        else:
            que[0][1] -= v_now - L
            vt_now -= (v_now - L)*que[0][0]
            v_now = L
            
            
    TT_list.append(vt_now / L)

for i in range(N):
    print(TT_list[i])


### FIXED CODE ###

# F
from collections import deque
 
TT_list = []
# input
N, L = map(int, input().split())
T = 0.0
vt_now = 0.0
v_now = 0
que = deque()

for i in range(N):
    ti, v = map(int, input().split())
    t = float(ti)
    v_now += v
    vt_now += v*t
    # add
    if v == L:
        que.append([t, v])
    else:
        while v < L and len(que) > 0:
            t_, v_ = que[-1]
            if t_ <= t:
                que.append([t, v])
                break
            elif v + v_ >= L:
                v_ = v + v_ - L
                t = ((L - v) * t_ + v * t) / L
                v = L
                que = deque([[t, v]])
                v_now = L
                vt_now = t*L
                # break
            else:
                t = (t*v + t_*v_) / (v + v_)
                v = v + v_
                que.pop()
    # minus
    while v_now > L:
        if que[0][1] <= v_now - L:
            v_now -= que[0][1]
            vt_now -= que[0][1]*que[0][0]
            que.popleft()
        else:
            que[0][1] -= v_now - L
            vt_now -= (v_now - L)*que[0][0]
            v_now = L
            
    TT_list.append(vt_now / L)

for i in range(N):
    print(TT_list[i])
import copy
 
INF = 10000000000
def merge(A, left, mid, right):
    count = 0
    L = A[left:mid] + [(INF,INF)]
    R = A[mid:right] + [(INF,INF)]
     
    i, j = 0, 0
    for k in range(left, right):
        count = count + 1
        if L[i][1] <= R[j][1]:
            A[k] = L[i]
            i = i + 1
        else:
            A[k] = R[j]
            j = j + 1
    return count
 
def mergeSort(A, left, right):
    if left + 1 < right:
        mid = (left + right) // 2
        countL = mergeSort(A, left, mid)
        countR = mergeSort(A, mid, right)
        return merge(A, left, mid, right) + countL + countR
    return 0
def partition(a,p,r):
    x=a[r]
    i=p-1
    for j in range(p,r):
        if a[j]<=x:
            i+=1
            a[i],a[j]=a[j],a[i]
    a[i+1],a[r]=a[r],a[i+1]
    return i+1
def quickSort(a,p,r):
    if p<r:
        q=partition(a,p,r)
        quicksort(a,p,q-1)
        quicksort(a,q+1,r)
n = int(input())
A = [None for i in range(n)]
for i in range(n):
    a, b = input().split()
    A[i] = (a, int(b))
 
B = copy.deepcopy(A)
quickSort(A, 0, n-1)
mergeSort(B, 0, n)
if A == B:
    print("Stable")
else:
    print("Not stable")
 
ans = [str(x[0]) +" "+str(x[1]) for x in A]
ans = '\n'.join(ans)
print(ans)


### FIXED CODE ###

import copy
 
INF = 10000000000
def merge(A, left, mid, right):
    count = 0
    L = A[left:mid] + [(INF,INF)]
    R = A[mid:right] + [(INF,INF)]
     
    i, j = 0, 0
    for k in range(left, right):
        count = count + 1
        if L[i][1] <= R[j][1]:
            A[k] = L[i]
            i = i + 1
        else:
            A[k] = R[j]
            j = j + 1
    return count
 
def mergeSort(A, left, right):
    if left + 1 < right:
        mid = (left + right) // 2
        countL = mergeSort(A, left, mid)
        countR = mergeSort(A, mid, right)
        return merge(A, left, mid, right) + countL + countR
    return 0
def partition(a,p,r):
    x=a[r][1]
    i=p-1
    for j in range(p,r):
        if a[j][1]<=x:
            i+=1
            a[i],a[j]=a[j],a[i]
    a[i+1],a[r]=a[r],a[i+1]
    return i+1
def quickSort(a,p,r):
    if p<r:
        q=partition(a,p,r)
        quickSort(a,p,q-1)
        quickSort(a,q+1,r)
n = int(input())
A = [None for i in range(n)]
for i in range(n):
    a, b = input().split()
    A[i] = (a, int(b))

B = copy.deepcopy(A)
quickSort(A, 0, n-1)
mergeSort(B, 0, n)
if A == B:
    print("Stable")
else:
    print("Not stable")
ans = [str(x[0]) +" "+str(x[1]) for x in A]
ans = '\n'.join(ans)
print(ans)
def gcd(x, y):
    r = 1
    for i in range(1, min(x, y)):
        if x % i == 0 and y % i == 0:
            r = i
    return r

x, y = map(int, re.split(' ', raw_input()))
print(gcd(x, y))

### FIXED CODE ###

import re

def gcd(x, y):
    if x == y:
        return x
    if x < y and y % x == 0:
        return x
    if x > y and x % y == 0:
        return y
    if x <= y:
        m = y % x
        return gcd(x, m)
    if x >= y:
        m = x % y
        return gcd(y, m)

    l = list(range(1, int(min(x, y) / 2) + 1))
    l.reverse()
    r = 1
    for i in l:
        if x % i == 0 and y % i == 0:
            return i
    return 1
 
x, y = map(int, re.split(' ', raw_input()))
print(gcd(x, y))
if X = 3 or 5 or 7:
  print('YES')
else:
  print('NO')
  

### FIXED CODE ###

X = int(input())

if X==3 or X==5 or X==7:
  print("YES")
else:
  print("NO")
A = []
for _ in range(3):
    a = list(map(int, input().split()))
    A.append(a)

import numpy as np
A = np.array(A)

N = int(input())
B = []
for _ in range(N):
    B.append(int(input()))

ans = [[False] * 3 for _ in range(3)]
ans = np.array(ans)

for b in B:
    temp = (A == b)

    ans = np.logical_or(ans, temp)


if ans[0, :].all() or ans[1, :].all() or ans[2, :].all():
    print("Yes")

elif ans[:, 0].all() or ans[:, 1].all() or ans[:, 2].all():
    print("Yes")

elif ans[0, 0] and ans[1, 1] and ans[2, 2]:
    print("Yes")
elif ans[0, 2] and ans[1, 1] and ans[2, 0]:
    print("Yes")
else:
    print("No")




### FIXED CODE ###

A = []
for _ in range(3):
    a = list(map(int, input().split()))
    A.append(a)

import numpy as np
A = np.array(A)

N = int(input())
B = []
for _ in range(N):
    B.append(int(input()))

ans = [[False] * 3 for _ in range(3)]
ans = np.array(ans)

for b in B:
    temp = (A == b)

    ans = np.logical_or(ans, temp)


if ans[0, :].all() or ans[1, :].all() or ans[2, :].all():
    print("Yes")

elif ans[:, 0].all() or ans[:, 1].all() or ans[:, 2].all():
    print("Yes")

elif ans[0, 0] and ans[1, 1] and ans[2, 2]:
    print("Yes")
elif ans[0, 2] and ans[1, 1] and ans[2, 0]:
    print("Yes")
else:
    print("No")
n, h = map(int, input().split())
a = []
b = []
amax = 0
for i in range(n):
  ai, bi = map(int, input().split())
  if amax < ai:
    amax = ai
  a.append(ai)
  b.append(bi)

b = [b[j] for j in range(n) if b[j] > amax]
sumb = sum(b)
if sumb >= h:
  s = 0
  b = sorted(b)
  c = 0
  while s < h:
    s += b[-1]
    b.pop(-1)
    c + =1
  print(c)
else:
  print((h-sumb)//amax+((h-sumb)%amax!=0) + len(b))



### FIXED CODE ###

n, h = map(int, input().split())
a = []
b = []
amax = 0
for i in range(n):
  ai, bi = map(int, input().split())
  if amax < ai:
    amax = ai
  a.append(ai)
  b.append(bi)

b = [b[j] for j in range(n) if b[j] > amax]
sumb = sum(b)
if sumb >= h:
  s = 0
  b = sorted(b)
  c = 0
  while s < h:
    s += b[-1]
    b.pop(-1)
    c += 1
  print(c)
else:
  print((h-sumb)//amax+((h-sumb)%amax!=0) + len(b))
n,m=map(int,input().split())
like=[]
for i in range(n):
    like+=list(map(int,input()))
print(len(set(like)))

### FIXED CODE ###

n,m=map(int,input().split())
like=[]
for i in range(n):
    k,*a=map(int,input().split())
    like+=a
ans=0
for i in range(1,m+1):
    if like.count(i)==n:
        ans+=1
print(ans)
from scipy.sparse.csgraph import floyd_warshall

n,m=map(int,input().split())
l=[list(map(int,input().split())) for i in range(m)]

cnt=0
for i in range(m):
  ll=deepcopy(l)
  del ll[i]

  d=[[float('inf')]*n for i in range(n)]
  for i in range(n):
    d[i][i]=0

  for a,b in ll:
    a-=1
    b-=1
    d[a][b]=1
    d[b][a]=1

  s=floyd_warshall(d)
  for i in s:
    if float('inf') in i:
      cnt+=1
      break

print(cnt)

### FIXED CODE ###

from collections import deque

n,m=map(int,input().split())
l=[list(map(int,input().split())) for i in range(m)]

def make_dict(x,y):
    for i in ll:
        if i[x] in d.keys():
            d[i[x]]+=[i[y]]
        else:
            d[i[x]]=[i[y]]

cnt=0
for i in range(m):
    ll=l[:i]+l[i+1:]
#    print(ll)
    d={}
    make_dict(0,1)
    make_dict(1,0)
#    print(d)
    k_l=list(d.keys())
    v_l=list(d.values())
#    print(k_l)

    x=0
    sk=k_l[x]
    dq=deque()
    dq.append(sk)
#    while dq:
#    print(dq)
#    x=0
    seen=[]
    while dq:
#    while n<10:
        k=dq.pop()
        k_ll=d[k]
        seen.append(k)
#        print(k_ll)
        for i in k_ll:
            if i not in seen:
                dq.append(i)
#        d=d.pop(sk)
#        print(dq)
        x+=1
#    print(set(seen),len(set(seen)))
    if len(set(seen))!=n:
        cnt+=1
print(cnt)
N, M = map(int,input().split())

for i in range(1,M+1):
    if M%i == 0:
        if  M//i >= N:
            ans = i
        else:
            break
    
print(ans)

### FIXED CODE ###

import math
N = int(input())

p = [i for i in range(2,N+1)]
q = []

for i in p:
    for j in range(2,i):
        if i%j==0:
            q.append(i)
            break
        
p = list(set(p)-set(q))

def div(n):
    ret=0
    a=math.factorial(N)
    while a%n == 0:
        a//=n
        ret+=1
    return ret

Ans=0

for n in p:
    if div(n)>=74:
        Ans+=1

for n in p:
    if div(n)>=24:
        for m in p:
            if div(m)>=2 and n!=m:
                Ans += 1

        
for n in p:
    if div(n)>=14:
        for m in p:
            if div(m)>=4 and n!=m:
                Ans += 1

for n in p:
    if div(n)>=2:
        for m in p:
            if n!=m and div(m)>=4:
                for l in p:
                    if l!=n and l>m and div(l)>=4:
                        Ans +=1

print(Ans)
n,m,c=map(int,input().split())
b=list(int,input())
a=[list(map(int,input().split())) for i in range(n)]
count=0
for i in range(n):
  sum=c
  for j in range(m):
    sum+=a[i,j]*b[j]
  if sum>0:
    sum+=1
print(sum)

### FIXED CODE ###

n,m,c=map(int,input().split())
a=[list(map(int,input().split())) for i in range(n+1)]
count=0
for i in range(n):
  sum=c
  for j in range(m):
    sum+=a[i+1][j]*a[0][j]
  if sum>0:
    count+=1
print(count)
num  = int(input())
#prime number counter
ans = 0
prime_check = [1]*1000100
count = 2
while num>1:
    if prime_check[count]==1: #countが素数だった場合
        tmp = 0
        while num % count == 0: #numの因数にcountが何個含まれているか
            num/= count
            tmp += 1
        tmp2 =1
        while tmp>=tmp2: #ansに加える
            ans += 1
            tmp -= tmp2
            tmp2 += 1
        tmp = count
        while tmp*count<=1e6:
            prime_check[tmp*count] = 0
            tmp += 1
    count += 1

print(ans)

### FIXED CODE ###

num  = int(input())
#prime number counter
ans = 0
prime_check = [1]*1000100
count = 2
while num>1:
    if prime_check[count]==1: #countが素数だった場合
        tmp = 0
        while num % count == 0: #numの因数にcountが何個含まれているか
            num/= count
            tmp += 1
        tmp2 =1
        while tmp>=tmp2: #ansに加える
            ans += 1
            tmp -= tmp2
            tmp2 += 1
        tmp = count
        while tmp*count<=1e6:
            prime_check[tmp*count] = 0
            tmp += 1
    count += 1
    if(count>1e6):
        num = 0
        ans += 1
print(ans)
N=int(input())
A=list(map(int,input().split()))
D=[0]*3
ans=1
for i in A:
  c=0
  E=[]
  if i==D[0]:
    c+=1
    E.append(0)
  if i==D[1]:
    c+=1
    E.append(1)
  if i==D[2]:
    c+=1
    E.append(2)
  D[E[0]]+=1
  ans*=c
  ans%=10**9+7
print(ans)

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
D=[0]*3
ans=1
for i in A:
  c=0
  E=[]
  if i==D[0]:
    c+=1
    E.append(0)
  if i==D[1]:
    c+=1
    E.append(1)
  if i==D[2]:
    c+=1
    E.append(2)
  if c==0:
    print(0)
    exit()
  D[E[0]]+=1
  ans*=c
  ans%=10**9+7
print(ans)
#16D8101014F Kurume Ryunosuke 久留米竜之介 2018/5/16 Python3
n = int(input())
box = set()

for i in range(n):
    tmp,mozi= input().split()
    
    if tmp == "find":
        if word in box:
            print("yes")
        else:
            print("no")
    else:
        box.add(mozi)


### FIXED CODE ###

#16D8101014F Kurume Ryunosuke 久留米竜之介 2018/5/16 Python3
n = int(input())
box = set()

for _ in range(n):
    tmp,mozi= input().split()
    
    if tmp == "find":
        if mozi in box:
            print("yes")
        else:
            print("no")
    else:
        box.add(mozi)
A, op, B = input().split()

num_A = int(A)
num_B = int(B)
if op == '+':
    print(num_A + numb_B)
else:
    print(num_A - num_B)

### FIXED CODE ###

A, op, B = input().split()

num_A = int(A)
num_B = int(B)
if op == '+':
    print(num_A + num_B)
else:
    print(num_A - num_B)
import sys
if sys.version_info[0]>=3: raw_input=input

n=int(raw_input())
for i in range(0,n):
	a=map(int,raw_input())
	a[0]-=1;a[1]-=1
	print(196471-a[0]*195-a[0]/3*5-a[1]*20+(a[1]/2 if a[0]%3!=2 else 0)-a[2])

### FIXED CODE ###

import sys
if sys.version_info[0]>=3: raw_input=input

n=int(raw_input())
for i in range(0,n):
	a=[int(e) for e in raw_input().split()]
	a[0]-=1;a[1]-=1
	print(196471-a[0]*195-a[0]//3*5-a[1]*20+(a[1]//2 if a[0]%3!=2 else 0)-a[2])
x = np.arange(1, K + 1)
nums = np.gcd.outer(np.gcd.outer(x, x), x)

### FIXED CODE ###

import numpy as np
 
K=int(input())
 
x = np.arange(1, K + 1)
nums = np.gcd.outer(np.gcd.outer(x, x), x)
print(nums.sum())