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

# https://note.nkmk.me/python-union-find/
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n
    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.parents[x] > self.parents[y]:
            x, y = y, x
        self.parents[x] += self.parents[y]
        self.parents[y] = x
    def size(self, x):
        return -self.parents[self.find(x)]
    def same(self, x, y):
        return self.find(x) == self.find(y)
    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]
    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]
    def group_count(self):
        return len(self.roots())
    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}
    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())


N, M = map(int, input().split())
uf = UnionFind(N)
for i in range(M):
    A, B = map(int, input().split())
    uf.union(A-1,B-1)
ans = 0
for i in uf.all_group_members().values():
    ans = max(ans,len(i))
print(ans)

### FIXED CODE ###

# https://note.nkmk.me/python-union-find/
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n
    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.parents[x] > self.parents[y]:
            x, y = y, x
        self.parents[x] += self.parents[y]
        self.parents[y] = x
    def size(self, x):
        return -self.parents[self.find(x)]
    def same(self, x, y):
        return self.find(x) == self.find(y)
    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]
    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]
    def group_count(self):
        return len(self.roots())
    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}
    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())


N, M = map(int, input().split())
uf = UnionFind(N)
ans = 0
if M == 0:
    print(1)
    exit()
for i in range(M):
    A, B = map(int, input().split())
    uf.union(A-1,B-1)
    ans = max(ans,uf.size(A-1))
print(ans)
### BUGGY CODE ###

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

from math import gcd
sum = 0
for i in range(N-2):
    for j in range(i+1,N):
        for k in range(j+1, N):
#            print(i, j, k)
            if S[i] == S[j] or S[j] == S[k] or S[i] == S[k]:
                continue
            elif j - i == k - j:
                continue
            else:
                sum += 1

print(sum)

### FIXED CODE ###

N = int(input())  #数字
S = list(input()) #スペース抜きの複数行,１文字ずつ

cou = 0

for i in range(0,N):
    j = 1
    while i + (2 * j) <= N-1:
        if S[i] != S[i + j] and S[i + j] != S[i + (2*j)] and S[i] != S[i + (2*j)]:
            cou += 1
        j += 1

print(S.count("R")*S.count("G")*S.count("B")-cou)
### BUGGY CODE ###

temp = input()
temp = temp.split()
room = int(temp[0])
passage = int(temp[1])
adjlist = {}
visited = [0] * (room + 1) 
finalans = []
finalans.append(0)
for i in range(passage):
    inpu = input()
    inpu = inpu.split()
    firstnode = int(inpu[0])
    secnode = int(inpu[1])
    if firstnode not in adjlist:
        adjlist[firstnode] = []
    if secnode not in adjlist:
        adjlist[secnode] = []
        
    adjlist[firstnode].append(secnode)
    adjlist[secnode].append(firstnode)

flag = 0 
for i in range(2, room + 1):
    temparr = []
    ans = -1 
    visited = [0] * (room + 1) 
    if i not in adjlist:
        flag = 1 
        break
    templist = adjlist[i]
    if 1 in templist:
        finalans.append(1)
        continue 
    for j in templist:
        visited[j] = 1
        temparr.append((j, j))
    while True:
        if len(temparr) == 0:
            break
        getans = 0 
        newarr = []
        for node in temparr:
            newnode = node[0]
            firstnode = node[1]
            if newnode not in adjlist:
                continue 
            if 1 in adjlist[newnode] :
                getans = 1 
                ans = firstnode
                break
            for j in adjlist[newnode]:
                if visited[j] == 1 :
                    continue 
                visited[j] = 1 
                newarr.append((j, firstnode))
        
        if getans == 1:
            break
        
        temparr = newarr[::]
    
    if ans == -1:
        flag = 1 
        break
    finalans.append(ans)

if flag == 1:
    print("No")
#print(adjlist)
else:
    print("Yes")
    for i,j in enumerate(finalans):
        if i == 0 :
            continue 
        print(j)
#print(finalans)

### FIXED CODE ###

from collections import deque
newarr = input()
newarr = newarr.split()
n = int(newarr[0])
m = int(newarr[1])
dicts = {}
ans = [0] * (n + 1)
for line in range(m):
    newarr = input()
    newarr = newarr.split()
    froom = int(newarr[0])
    sroom = int(newarr[1])
    if froom not in dicts:
        dicts[froom] = []
    if sroom not in dicts:
        dicts[sroom] = []
    dicts[froom].append(sroom)
    dicts[sroom].append(froom)
queue = deque([])
if 1 not in dicts:
    print("No")
else:
    ans[1] = 1
    curarr = dicts[1]
    for i in curarr:
        queue.append(i)
        ans[i] = 1 
    while queue:
        curitem = queue.popleft()
        if curitem not in dicts:
            continue 
        curarr = dicts[curitem]
        for i in curarr:
            if ans[i] == 0:
                ans[i] = curitem 
                queue.append(i)

    finalans = []
    flag = 0 
    for i in range(2, n + 1):
        if i == 0 :
            flag = 1 
            break 
        finalans.append(ans[i])
    if flag == 1:
        print("No")
    else:
        print("Yes")
        for i in finalans:
            print(i)
### BUGGY CODE ###

import sys
import math
from  collections import defaultdict

# sys.stdin = open('input.txt', 'r')
# sys.stdout = open('output.txt', 'w')

def solve(test):
	n, w = map(int, input().split())
	val = [None] * n
	wgt = [None] * n
	for i in range(n):
		wgt[i], val[i] = map(int, input().split())
	dp = {}
	ans = knapsack(wgt, val, 0, n, dp, w)
	print(ans)

def knapsack(wgt, val, i, n, dp, w):
	if (i, w) in dp:
		return dp[(i, w)]
	elif i >= n:
		return 0
	else:
		dp[(i, w)] = knapsack(wgt, val, i + 1, n, dp, w)
		if wgt[i] <= w:
			dp[(i, w)] = max(dp[(i, w)], val[i] + knapsack(wgt, val, i + 1, n, dp, w - wgt[i]))
		return dp[(i, w)]


if __name__ == "__main__":
	test_cases = 1
	for t in range(1, test_cases + 1):
		solve(t)


### FIXED CODE ###

import sys
import math
from  collections import defaultdict


# sys.stdin = open('input.txt', 'r')
# sys.stdout = open('output.txt', 'w')

def solve(test):
	n, w = map(int, input().split())
	val = [None] * n
	wgt = [None] * n
	for i in range(n):
		wgt[i], val[i] = map(int, input().split())
	dp = [[0 for j in range(w + 1)] for i in range(n + 1)]
	for i in range(1, n + 1):
		for j in range(1, w + 1):
			dp[i][j] = dp[i - 1][j]
			if wgt[i - 1] <= j:
				dp[i][j] = max(dp[i][j], val[i - 1] + dp[i - 1][j - wgt[i - 1]])
	ans = dp[-1][-1]
	print(ans)



if __name__ == "__main__":
	test_cases = 1
	for t in range(1, test_cases + 1):
		solve(t)
### BUGGY CODE ###

n=int(input())
As=[int(input()) for _ in range(n)]

ans=[]
for a in As:
  if a not in ans:
    ans.append(a)
  else:
    ans.remove(a)
print(len(ans))

### FIXED CODE ###

n=int(input())
As=[int(input()) for _ in range(n)]
As.sort()
As_uniq=list(set(As))

ans=0
c=1
for i in range(1,n):
  if As[i]==As[i-1]:
    c+=1
  else:
    if c%2==1:
      ans+=1
    c=1
if c % 2 == 1:
  ans += 1
print(ans)
### BUGGY CODE ###

N=int(input())
A= [int(i) for i in input().split()]
for i in range(1,N+1):
  ans=A.count(i)
  print(ans)

### FIXED CODE ###

N=int(input())
A=list(map(int, input().split()))
cnt=[0]*N

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

for j in range(N):
  print(cnt[j])
### BUGGY CODE ###

import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def _I(): return int(sys.stdin.readline())
def _F(): return float(sys.stdin.readline())
def _pf(s): return print(s, flush=True)

N = _I()
T = set([_I() for _ in range(N)])

times = 1
max_v = max(T)
new_T = []
for t in T:
    if max_v % t != 0:
        new_T.append(t)
T = new_T
while True:
    max_t = max_v * times
    for t in T:
        if max_t % t != 0:
            times += 1
            break
    else:
        print(max_t)
        break




### FIXED CODE ###

import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def _I(): return int(sys.stdin.readline())
def _F(): return float(sys.stdin.readline())
def _pf(s): return print(s, flush=True)

N = _I()
T = set([_I() for _ in range(N)])

def lcm(a,b):
    g = fractions.gcd(a,b)
    return a * b // g

l = 1
for t in T:
    l = lcm(l, t)

print(l)
### BUGGY CODE ###

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

a.sort()
bc.sort(key=lambda x:x[1],reverse=True)
ans = 0
for i in bc:
  #  print(a)
    count = 0
    for j in range(min(i[0],len(a))):
        if a[j] < i[1]:
            ans += i[1]
            count += 1
        else:
            break
    a = a[count:]
print(ans+sum(a))

### FIXED CODE ###

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

for i in a:
    bc.append([1,i])
bc.sort(key=lambda x:x[1],reverse=True)
#print(bc)
ans = 0
for i in bc:
    d = min(i[0],n)
 #   print(d)
    ans += i[1] * d
    n -= d
print(ans)
### BUGGY CODE ###

# -*- coding utf-8 -*-
import copy

MOD = 10 ** 9 + 7

n = int(input())

graph = [[-1] * n for _ in range(n)]
for _ in range(n - 1):
    u, v, w = map(int, input().split())
    graph[u - 1][v - 1] = w
    graph[v - 1][u - 1] = w

root = 0
dist = [-1] * (n)
new = {0}
not_yet = set(list(range(n)))
not_yet -= {0}
while len(new) != 0:
    next_new = set()
    for i in new:
        for j in not_yet:
            if graph[i][j] != -1:
                dist[j] = dist[i] + graph[i][j]
                next_new.add(j)
    not_yet -= next_new
    new = next_new

for d in dist:
    print(d % 2)



### FIXED CODE ###

# -*- coding utf-8 -*-

MOD = 10 ** 9 + 7

n = int(input())

graph = [[] for _ in range(n)]
for _ in range(n - 1):
    u, v, w = map(int, input().split())
    graph[u - 1].append((v - 1, w))
    graph[v - 1].append((u - 1, w))

dist = [-1] * n
dist[0] = 0
que = [0]
while len(que) != 0:
    i = que.pop()
    for j, w in graph[i]:
        if dist[j] == -1:
            dist[j] = dist[i] + w
            que.append(j)

for d in dist:
    print(d % 2)
### BUGGY CODE ###

n, k = map(int, input().split())
a = list(map(int, input().split()))
a = [0] + a
c = [1]
count = 0

x = True

while x:
    count += 1
    c.append(a[c[-1]])
    if count == k:
        ans = c[-1]
        x = False
    if c[-1] in c[0:-1]:
        s = c.pop()
        t = c.index(s)
        u = len(c) - t
        x = False
        m = (k-t) %  u
        ans = c[t+m]
        
print(ans)

### FIXED CODE ###

n, k = map(int, input().split())
a = list(map(int, input().split()))
a = [0] + a
c = [1]
x = True
y = [1, 1] + [0]*(n-1)

while x:
    c.append(a[c[-1]])
    y[c[-1]] += 1
    if y[c[-1]] == 2:
        x = False

t = c.index(c[-1])
if k <= t:
    ans = c[k]
else:
    ans = c[t + ((k-t) % (len(c)-1-t))]

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

#!/usr/bin/env python3
import sys
import numpy as np

def solve(N: int, S: str):
    r = []
    g = []
    b = []
 
    for i, x in enumerate(S):
        if x ==  "R":r.append(i)
        elif x =="G":g.append(i)
        else:b.append(i)

    r = np.array(r)
    g = np.array(g)
    b = np.array(b)
  
    sb = set(b)
    ans = 0
    for r_ in r:
        # rg
        for g_ in g[g>r_]:
            # rgb
            if (g_ + (g_ - r_)) in sb:
                ans -= 1
            # brg
            if (r_ - (g_ - r_)) in sb:
                ans -= 1
            # rbg
            if ((r_ + g_)/2) in sb:
                ans -= 1

        # gr
        for g_ in g[g<r_]:
            # grb
            if (r_ + (r_ - g_)) in sb:
                ans -= 1
            # bgr
            if (g_ - (r_ - g_)) in sb:
                ans -= 1
            # gbr
            if ((r_ + g_)/2) in sb:
                ans -= 1
        ans += len(b) * len(g)
    print(ans)
  
    return
 
 
# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    S = next(tokens)  # type: str
    solve(N, S)
 
if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
from collections import deque

def solve(N: int, S: str):
    r = []
    g = []
    b = []
    rp = 0
    gp = 0
    bp = 0

    rsum = [0]*(N+1)
    bsum = [0]*(N+1)
    gsum = [0]*(N+1)

    for i, x in enumerate(S[::-1]):
        if x ==  "R":
            r.append(i)
            rp = 1
        elif x =="G":
            g.append(i)
            gp = 1
        else:
            b.append(i)
            bp = 1
        rsum[N-1-i] = rsum[N-1-i+1] + rp
        gsum[N-1-i] = gsum[N-1-i+1] + gp
        bsum[N-1-i] = bsum[N-1-i+1] + bp
        rp = 0
        gp = 0
        bp = 0
    ans = 0
    for i in range(N):
        for j in range(i+1, N):
            if S[i] != S[j]:
                if j+j-i<N: k = S[j+j-i]
                else: k = ""
                if (S[i] == "R" and S[j] == "B") or (S[j] == "R" and S[i] == "B"):
                    ans += gsum[j] - (k=="G")*1
                elif (S[i] == "R" and S[j] == "G") or (S[j] == "R" and S[i] == "G"):
                    ans += bsum[j] - (k=="B")*1
                elif (S[i] == "G" and S[j] == "B") or (S[j] == "G" and S[i] == "B"):
                    ans += rsum[j] - (k=="R")*1
    

    print(ans)
  
    return
 
 
# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    S = next(tokens)  # type: str
    solve(N, S)
 
if __name__ == '__main__':
    main()
### BUGGY CODE ###

s = 0
answer = 1
d = {}
N = int(input())
n = N

if n < 105:
    print("0")
else:
    if n == 105 or n == 106:
        print("1")
    for i in range(107,N+1,2):
        for j in range(2,i+1):
            s = 0
            while s == 0:
                if i % j == 0:
                    if str(j) in d:
                        d[str(j)] += 1
                    else:
                        d[str(j)] = 1
                else:
                    s = 1
        r = 1
        for k in d:
            r *= (k+1)
        if r == 8:
            answer += 1
        
        print(answer)

### FIXED CODE ###

N = int(input())
s = 0
for i in range(1,N+1,2):
    st = 0
    for j in range(1,i+1):
        if i% j == 0:
            st += 1
    if st == 8:
        s += 1
print(s)
### BUGGY CODE ###

n,m = map(int, input().split())
a = [int(_) for _ in input().split()]
idx = 0
for i in range(m):
    b,c = map(int, input().split())
    a += [c]*b
    idx += b
a.sort()
print(sum(a[idx:]))

### FIXED CODE ###

from heapq import heappop, heappush


n,m = map(int,input().split())
A = list(map(int,input().split()))
pq = []
ans = 0

for a in A:
    heappush(pq, [-a, 1])
    
for _ in range(m):
    b,c = map(int,input().split())
    heappush(pq, [-c, b])

for i in range(n):
    c,b = heappop(pq)
    c = -c
    ans += c
    if b > 1:
        b -= 1
        heappush(pq, [-c, b])
        
print(ans)
### BUGGY CODE ###

n,m = map(int,input().split())
First = []
Second = []
for i in range(m):
    a,b = map(int,input().split())
    if a == 1:
        First.append(b)
    if b == n:
        Second.append(a)
for i in range(1,n+1):
    if i in First and i in Second:
        print("POSSIBLE")
        exit()
print("IMPOSSIBLE")


### FIXED CODE ###

n,m = map(int,input().split())
route = [0]*(n+10)
for i in range(m):
    a,b = map(int,input().split())
    if a == 1:
        route[b] += 1
    if b == n:
        route[a] += 1
if 2 in route:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
### BUGGY CODE ###

N,M = map(int,raw_input().split())
es = [[] for i in range(N)]
for i in range(M):
  a,b = map(int,raw_input().split())
  a,b = a-1,b-1
  es[a].append(b)
  es[b].append(a)

colors = [0 for i in range(N)]

def is_bipartite():
  stack = [(0,1)]
  while stack:
    v,color = stack.pop()
    colors[v] = color
    for to in es[v]:
      if colors[to] == color:
        return False
      if colors[to] == 0:
        stack.append((to, -color))
  return True

if is_bipartite():
  b = (sum(colors) + N) // 2
  w = N-b
  print(b*w - M)
else:
  all = N*(N-1) // 2
  print(all - M)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)

N,M = map(int,raw_input().split())
es = [[] for i in range(N)]
for i in range(M):
  a,b = map(int,raw_input().split())
  a,b = a-1,b-1
  es[a].append(b)
  es[b].append(a)

colors = [0 for i in range(N)]

def dfs(v,color):
  colors[v] = color
  for to in es[v]:
    if colors[to] == color:
      return False
    if colors[to] == 0 and not dfs(to, -color):
      return False
  return True

def is_bipartite():
  return dfs(0,1)

if is_bipartite():
  b = (sum(colors) + N) // 2
  w = N-b
  print(b*w - M)
else:
  all = N*(N-1) // 2
  print(all - M)
### BUGGY CODE ###

# sys.stdin.readline()
import sys
input = sys.stdin.readline

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

#output
import fractions
import  functools
import numpy as np

mod = 10**9 + 7

gcd = functools.reduce(fractions.gcd, A)

def lcm_base(x, y):
    return (x*y) // fractions.gcd(x, y)
def lcm_list(numbers):
    return functools.reduce(lcm_base, numbers, 1)

lcm =  lcm_list(A)

answer = 0
for i in range(N):
    answer += lcm//A[i]

print(answer % mod)

### FIXED CODE ###

import sys
input = sys.stdin.readline
 
#input
N = int(input())
A = list(map(int, input().split()))
 
#output
import fractions, functools
 
def lcm_base(x, y):
    return (x*y) // fractions.gcd(x, y)
def lcm_list(numbers):
    return functools.reduce(lcm_base, numbers, 1)
 
lcm = lcm_list(A)
 
answer = 0
for i in range(N):
    answer += lcm//A[i]
 
print(answer % (10**9 + 7))
### BUGGY CODE ###

import sys
import math


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

n = inint()

z = {():0}
ans = 0

def combinations(n, r):
    if n < r:
        return 0
    else:
        return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

for i in range(n):
    c = [0]*123
    s = input()
    for j in range(len(s)):
        c[ord(s[j])] += 1
    try:
        z[tuple(c)] += 1
    except:
        z[tuple(c)] = 1

for i in z:
    ans += combinations(z[i],2)

print(ans)

### FIXED CODE ###

import sys
import math


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

n = inint()

z = {():0}
ans = 0

def combinations(n, r):
    if n < r:
        return 0
    else:
        return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

for i in range(n):
    c = [0]*123
    s = input()
    for j in range(len(s)):
        c[ord(s[j])] += 1
    try:
        z[tuple(c)] += 1
    except:
        z[tuple(c)] = 1

for i in z:
    ans += combinations(z[i],2)

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

import sys
sys.setrecursionlimit(1000000)

count = 0
a = []
while(1):
    try:
        count += 1
        a.append([int(i) for i in input().split(",")])
    except EOFError:
        break
dim = int(count/2)
b = [[0 for i in range(dim+1)] for j in range(dim+1)]
for i in range(dim):
    for j in range(i+1):
        b[i-j][j] = a[i][j]
for i in range(dim-1):
    for j in range(dim-i-1):
        b[dim-1-j][i+1+j] = a[i+dim][j]

dp_ = [[True if i < dim else 0 for i in range(dim+1)] if j < dim else [0 for i in range(dim+1)] for j in range(dim+1)]

def dp(i,j):
    global dp_
    if dp_[i][j]:
        dp_[i][j] = b[i][j] + max(dp(i+1,j),dp(i,j+1))
    return dp_[i][j]

print(dp(0,0))


### FIXED CODE ###

from copy import copy
import sys
sys.setrecursionlimit(1000000)

count = 0
a = []
while(1):
    try:
        a.append([int(i) for i in input().split(",")])
        count += 1
    except EOFError:
        break
dim = int(count/2)+1
b = [[0 for i in range(dim+1)] for j in range(dim+1)]
for i in range(dim):
    for j in range(i+1):
        b[i-j][j] = a[i][j]
for i in range(dim-1):
    for j in range(dim-i-1):
        b[dim-1-j][i+1+j] = a[i+dim][j]

dp_ = [[True if i < dim else 0 for i in range(dim+1)] if j < dim else [0 for i in range(dim+1)] for j in range(dim+1)]

def dp(i,j):
    global dp_
    if dp_[i][j] is True:
        dp_[i][j] = b[i][j] + max(dp(i+1,j),dp(i,j+1))
        return dp_[i][j]
    else:
        return dp_[i][j]

print(dp(0,0))
### BUGGY CODE ###

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

for i in range(1,n+1):
  print(a.count(i))

### FIXED CODE ###

import collections

n=int(input())
a=list(map(int,input().split()))
coun=collections.Counter(a)
for i in range(1,n+1):
  print(coun[i])
### BUGGY CODE ###

n = int(input())
l = [1]*(n+1)
l[0] = 0
ans = l[1]
for i in range(2,n+1):
    for j in range(i,n+1,i):
        l[j] += 1

    ans += (l[i]*i)

print(ans)


### FIXED CODE ###

from numba import njit
@njit("i8(i8)")

def f(n):

    
    l = [1]*(n+1)
    l[0] = 0
    ans = l[1]
    for i in range(2,n+1):
        for j in range(i,n+1,i):
            l[j] += 1

        ans += (l[i]*i)
    return ans

n = int(input())
print(f(n))