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

import sys
import math


def yakusu(K):
    Y = set()
    for i in range(1, int(math.sqrt(K)) + 1):
        if K % i == 0:
            Y.add(i)
            Y.add(K // i)
    return len(Y)


def main():
    N = int(sys.stdin.readline().rstrip())

    sum_ = 0
    for k in range(1, N + 1):
        sum_ += k * yakusu(k)

    print(sum_)


main()


### FIXED CODE ###

import sys
import math


def main():
    N = int(sys.stdin.readline().rstrip())

    sum_ = 0

    for i in range(1, int(math.sqrt(N)) + 1):

        sum_ += i**2

        k1 = N // i
        # k2 = i

        k1_sum = k1 * (k1 + 1) // 2
        k2_sum = i * (i + 1) // 2
        sum_ += 2 * i * (k1_sum - k2_sum)

    print(sum_)


main()
### BUGGY CODE ###

N = int(input())
As = list(map(int, input().split()))
As.insert(0,-1)
cnt = 0
for i in range(N+1):
    for j in range(i,N+1):
        if i >= j:
            continue
        if As[i] == j and As[j] == i:
            cnt += 1
print(cnt)


### FIXED CODE ###

N = int(input())
As = list(map(int, input().split()))
As.insert(0,-1)
cnt = 0
for i in range(N+1):
    j = As[i]
    if j <= i:
        continue
    if As[j] == i:
        cnt += 1
print(cnt)
### BUGGY CODE ###

import sys
sys.setrecursionlimit(100000)

N, K = list(map(int, input().split()))
ab = []
for i in range(N-1):
    ab.append(list(map(int, input().split())))

ki = []

for i in range(N):
    ki.append(dict())
    ki[-1]["eda"] = []

for i in range(N-1):
    ki[ab[i][0] - 1]["eda"].append([ab[i][0] - 1, ab[i][1] - 1])
    ki[ab[i][1] - 1]["eda"].append([ab[i][1] - 1, ab[i][0] - 1])

def P(m ,n):
    if m <= 0 or n <= 0:
        return 0
    else:
        num = 1
        for i in range(n):
            num *= m-i
        return num

def saiki(i, base, ki):
    num = 1
    eda_num = len(ki[i]["eda"])-1
    if eda_num == 0:
        return num
    num *= P(K-2, eda_num)

    for edge in ki[i]["eda"]:
        if edge[1] != base:
            num *= saiki(edge[1], i, ki)
            num = num % 1000000007
            #print(num)

    return num

total_num = K
if len(ki[0]["eda"]) != 0:
    total_num *= P(K-1, len(ki[0]["eda"]))
    for edge in ki[0]["eda"]:
        total_num *= saiki(edge[1], 0, ki)
        total_num = total_num % 1000000007
        if total_num == 0:
            break

print(total_num)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)
INF=10**9+7
def LI(): return list(map(int, sys.stdin.readline().split()))
 
def main():
    n, k = LI()
    graph=[[] for i in range(n)]
    for i in range(n-1):
        a,b=LI()
        graph[a-1].append(b-1)
        graph[b-1].append(a-1)
    ans=1
    check=[False]*n
    stack=[0]
    ans=1
    while len(stack)>0:
        x=stack.pop()
        check[x]=True
        count=0
        for i in graph[x]:
            if not check[i]:
                count+=1
                stack.append(i)
        if x==0:
            temp=1
            for i in range(count):
                temp=temp*(k-1-i)%INF
            ans=ans*temp%INF
        else:
            temp=1
            for i in range(count):
                temp=temp*(k-2-i)%INF
            ans=ans*temp%INF
    print((ans*k)%INF)
 
 
if __name__ == "__main__":
    main()
### BUGGY CODE ###

from operator import mul
from functools import reduce
cmb_cnt = {}
def combinations_count(n, r):
    global cmb_cnt
    if (n, r) in cmb_cnt:
        return cmb_cnt[(n, r)]
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    cmb_cnt[(n, r)] = numer // denom
    return numer // denom

n, k = map(int, input().split())
a_list = sorted(list(map(int, input().split())))

ans = 0
if k == 1:
    print(0)
else:
    for i in range(1, n+1):
        if i >= k:
            ans += a_list[i-1] * combinations_count(i-1, k-1)
        if n-i >= k-1:
            ans -= a_list[i-1] * combinations_count(n-i, k-1)
    ans %= 1000000007
    print(ans)


### FIXED CODE ###

MOD = 1000000007
# 二項係数
class COM():
    def __init__(self, MAX, MOD):
        self.MOD = MOD
        self.MAX = MAX
        self.fac = [1] * MAX
        self.finv = [1] * MAX
        inv = [1] * MAX
        for i in range(2, MAX):
            self.fac[i] = self.fac[i - 1] * i % MOD
            inv[i] = MOD - inv[MOD % i] * (MOD // i) % MOD
            self.finv[i] = self.finv[i - 1] * inv[i] % MOD
    def calc_COM(self, n, k):
        if n < k:
            return 0
        if n < 0 or k < 0:
            return 0
        if self.MAX <= n:
            return 0
        return self.fac[n] * (self.finv[k] * self.finv[n - k] % self.MOD) % self.MOD

com = COM(100000, MOD)
n, k = map(int, input().split())
a_list = sorted(list(map(int, input().split())))

ans = 0
if k == 1:
    print(0)
else:
    for i in range(1, n+1):
        if i >= k:
            ans += a_list[i-1] * com.calc_COM(i-1, k-1)
        if n-i >= k-1:
            ans -= a_list[i-1] * com.calc_COM(n-i, k-1)
    ans %= MOD
    print(ans)
### BUGGY CODE ###

import bisect, collections, copy, heapq, itertools, math, string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

from collections import deque
from collections import Counter
import bisect
from collections import defaultdict
import itertools

def main():
    N, Q = MI()
    #i行の一番右をline_right[i],　j列目の一番下をcolumn_under[j]とする。
    line_right = [N] * N
    column_under = [N] * N
    bla = pow(N - 2, 2)
    x_min = N
    y_min = N
    for i in range(Q):
        query = LI()
        if query[0] == 1:
            w = query[1]
            x = column_under[w]
            bla -= x - 2
            if w < x_min:
                for j in range(x):
                    line_right[j] = w
                x_min = w
        else:
            y = query[1]
            z = line_right[y]
            bla -= z - 2
            if y < y_min:
                for j in range(z):
                    column_under[j] = y
                y_min = y
    print(bla)
if __name__ == "__main__":
    main()



### FIXED CODE ###

import bisect, collections, copy, heapq, itertools, math, string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

from collections import deque
from collections import Counter
import bisect
from collections import defaultdict
import itertools

def main():
    N, Q = MI()
    #i行の一番右をline_right[i],　j列目の一番下をcolumn_under[j]とする。
    line_right = deque([(N, N)])
    line_right_keys = deque([N])
    column_under = deque([(N, N)])
    column_under_keys = deque([N])
    bla = pow(N - 2, 2)
    x_min = N
    y_min = N
    for i in range(Q):
        query = LI()
        if query[0] == 1:
            w = query[1]
            x = bisect.bisect_left(column_under_keys, w)
            bla -= column_under[x][1] - 2
            if w < x_min:
                line_right.appendleft((column_under[x][1], w))
                line_right_keys.appendleft(column_under[x][1])
                x_min = w
        else:
            y = query[1]
            z = bisect.bisect_left(line_right_keys, y)
            bla -= line_right[z][1] - 2
            if y < y_min:
                column_under.appendleft((line_right[z][1], y))
                column_under_keys.appendleft(line_right[z][1])
                y_min = y
    print(bla)
if __name__ == "__main__":
    main()
### BUGGY CODE ###

a=int(input())
b=list(map(int, input().split()))
for i in b:
    if b.count(i)==1:
        continue
    elif b.count(i)>1:
        print('NO')
        break
else:
    print('YES')


### FIXED CODE ###

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

if len(b) != len(set(b)):
    print('NO')
else:
    print('YES')
### BUGGY CODE ###

import numpy as np

N, K, Q = map(int, input().split())
A = [0]*Q
for i in range(Q):
    A[i] = int(input())
B = [K]*N    
n_a = np.array(B)
for i in range(Q):
    n_a -= 1
    n_a[A[i]-1] += 1
    
ans = n_a.tolist()

for i in ans:
    print("No" if i<1 else "Yes")

### FIXED CODE ###

N, K, Q = map(int, input().split())
A = [0]*Q
B = [K-Q]*N
for i in range(Q):
    A[i] = int(input())
    B[A[i]-1] += 1

for i in B:
    print("Yes" if i > 0 else "No")
### BUGGY CODE ###

from bisect import bisect_left
N,M,Q = map(int,input().split())
C = {i:[] for i in range(1,N+1)}
for _ in range(M):
    L,R = map(int,input().split())
    C[R].append(L)
for _ in range(Q):
    p,q = map(int,input().split())
    A = []
    for i in range(1,q+1):
        A += C[i]
    A = sorted(A)
    ind = bisect_left(A,p)
    print(len(A[ind:]))

### FIXED CODE ###

N,M,Q = map(int,input().split())
A = [[0 for _ in range(N+1)] for _ in range(N+1)]
for _ in range(M):
    L,R = map(int,input().split())
    A[L][R] += 1
B = [[0 for _ in range(N+2)] for _ in range(N+2)]
for i in range(N,0,-1):
    for j in range(1,N+1):
        B[i][j] = A[i][j]+B[i+1][j]+B[i][j-1]-B[i+1][j-1]
for _ in range(Q):
    p,q = map(int,input().split())
    print(B[p][q])
### BUGGY CODE ###

def max_cont(n,a_l):
    for i in range(n):
        b = a_l.copy()
        b[i] = 0
        print(max(b))

n = int(input())
a = [int(input()) for _ in range(n)]
b = []
max_cont(n,a)

### FIXED CODE ###

n = int(input())
a = [int(input()) for _ in range(n)]
b = sorted(a.copy(), reverse=True)
for i in range(n):
    if a[i] == b[0]:
        print(b[1])
    else:
        print(b[0])
### BUGGY CODE ###

#!/usr/bin python3
# -*- coding: utf-8 -*-

from collections import deque
def main():
    N = int(input())
    Node = [set() for _ in range(N)]
    Edge = {}
    for i in range(N-1):
        a , b = map(int, input().split())
        a-=1
        b-=1
        if b<a:
            a, b = b, a
        Edge[(a, b)]=i
        Node[a].add(b)
        Node[b].add(a)

    K = 0
    for i, x in enumerate(Node):
        if len(x)>K:
            K = len(x)
            top = i


    q = deque()
    seen = [False]*(N-1)
    used = [set() for _ in range(N)]
    q.append(top)
    while len(q)>0:
        cur = q.popleft()
        for i in Node[cur]:
            if cur>i:
                ed = (i, cur)
            else:
                ed = (cur, i)
            if seen[Edge[ed]]==False:
                col = 1
                while col in used[cur] or col in used[i]:
                    col+=1
                seen[Edge[ed]] = col
                used[cur].add(col)
                used[i].add(col)
                q.append(i)

    print(K)
    print('\n'.join(map(str, seen)))

if __name__ == '__main__':
    main()

### FIXED CODE ###

#!/usr/bin python3
# -*- coding: utf-8 -*-

from collections import deque
def main():
    N = int(input())
    Node = [set() for _ in range(N)]
    Edge = {}
    for i in range(N-1):
        a , b = map(int, input().split())
        a-=1
        b-=1
        if b<a:
            a, b = b, a
        Edge[(a, b)]=i
        Node[a].add(b)
        Node[b].add(a)

    K = 0
    for i, x in enumerate(Node):
        if len(x)>K:
            K = len(x)
            top = i


    q = deque()
    seen = [False]*(N-1)
    used = [set() for _ in range(N)]
    q.append(top)
    while len(q)>0:
        cur = q.popleft()
        col = 1
        for i in Node[cur]:
            if cur>i:
                ed = (i, cur)
            else:
                ed = (cur, i)
            if seen[Edge[ed]]==False:
                while col in used[cur] or col in used[i]:
                    col+=1
                seen[Edge[ed]] = col
                used[cur].add(col)
                used[i].add(col)
                q.append(i)

    print(K)
    print('\n'.join(map(str, seen)))

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

N = int(input())
S_list = []
S_count_list = []

for n in range(N):
    s = input()

    if s in S_list:
        index_s = S_list.index(s)
        S_count_list[index_s] += 1
    
    else:
        S_list.append(s)
        S_count_list.append(1)

max_list = [i for i, v in enumerate(S_count_list) if v == max(S_count_list)]

max_S_list = []
for i in max_list:
    max_S_list.append(S_list[i])

max_S_list.sort()

for ans_s in max_S_list:
    print(ans_s)





### FIXED CODE ###

N = int(input())
S_dic = {}

for n in range(N):
    S = input()

    if S in S_dic:
        S_dic[S] += 1
    else:
        S_dic[S] = 1


# 最大のvalueを取得する
max_value = max(S_dic.values())

max_S_list = [k for k, v in S_dic.items() if v == max_value]
max_S_list = sorted(max_S_list)

for max_S in max_S_list:
    print(max_S)
### BUGGY CODE ###

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

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

### FIXED CODE ###

import numpy as np
N, W = map(int, input().split())

dp = np.zeros(W+1, dtype=np.int64)
for i in range(N):
	w, v = map(int, input().split())
	np.maximum(dp[w:], dp[:-w] + v, out= dp[w:])
print(dp[-1])
### BUGGY CODE ###

R, G, B, N = map(int, input().split())
ans = 0
for r in range(N // R + 1):
    for g in range(N // G + 1):
        b = N - r * R - g * G
        if b < 0 or b % B != 0:
            continue
        ans += 1
print(ans)

### FIXED CODE ###

R, G, B, N = map(int, input().split())
ans = 0
for r in range(N // R + 1):
    for g in range(N // G + 1):
        b = N - r * R - g * G
        if b < 0 or b % B != 0:
            continue
        ans += 1
print(ans)
### BUGGY CODE ###

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

box=[]
for i in range(n,0,-1):
  t=0
  for j in box:
    if j%i == 0:
      t+=1
  if t%2 != a[i]:
    box.append(i)
else:
  print(len(box))
  box=[str(i) for i in box]
  print(" ".join(box))
#print(-1)

### FIXED CODE ###

n = int(input())
a = [0]+list(map(int, input().split()))
boxi=[0]*(n+1)
box=[]
for i in range(n,0,-1):
  t=0
  for j in range(2,n//i+1):
    if boxi[j*i] == 1:
      t+=1
  if t%2 != a[i]:
    box.append(i)
    boxi[i]=1
else:
  print(len(box))
  box=[str(i) for i in box]
  print(" ".join(box))
#print(-1)
### BUGGY CODE ###

from functools import lru_cache


@lru_cache(None)
def factrial(n):
    ans = 1
    for i in range(1, n+1):
        ans *= i
    return ans


@lru_cache(None)
def combinations(n, r):
    return factrial(n) // (factrial(n - r) * factrial(r))


def main():
    n, k = map(int, input().split())
    A = sorted(map(int, input().split()))
    ans = 0
    mod = 10 ** 9 + 7
    for i, a in enumerate(A[k - 1:], k - 1):
        ans += ((a % mod) * (combinations(i, k - 1) % mod)) % mod
        ans %= mod
    for i, a in enumerate(A[: n - k + 1], 1):
        ans -= ((a % mod) * (combinations(n - i, k - 1)) % mod) % mod
        ans %= mod
    print(ans)


if __name__ == "__main__":
    main()


### FIXED CODE ###

from functools import lru_cache
n, k = map(int, input().split())
A = sorted(map(int, input().split()))
mod = 10 ** 9 + 7
# 階乗とその逆元の計算
factrial = [0 for _ in range(n + 1)]
factrial[0] = 1
for i in range(1, n + 1):
    factrial[i] = (factrial[i - 1] * i) % mod
inverse_factrial = list()
for f in factrial:
    inverse_factrial.append(pow(f, -1, mod))


@lru_cache(maxsize=None)
def nCr(n, r):
    return (factrial[n] * inverse_factrial[r] * inverse_factrial[n - r]) % mod


ans = 0
# 最大値の和
for i, a in enumerate(A[k - 1:], k - 1):
    ans += ((a % mod) * nCr(i, k-1)) % mod
    ans %= mod
# 最小値の和
A.reverse()
for i, a in enumerate(A[k - 1:], k - 1):
    ans -= ((a % mod) * nCr(i, k-1)) % mod
    ans %= mod
print(ans)
### BUGGY CODE ###

n = int(input())
a = list(map(int, input().split()))
ans = a[0]
for i in range(1, n):
  ans *= a[i]
if ans > 10 ** 18:
  ans = -1
print(ans)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
ans = a[0]
if 0 in a:
  ans = 0
else:
  for i in range(1, n):
    if ans < 10 ** 18:
      ans *= a[i]
    else:
      break
if ans > 10 ** 18:
  ans = -1
print(ans)
### BUGGY CODE ###

N=int(input())
A=[int(input()) for i in range(N)]
B=list(set(A))
count=0
for i in range(len(B)):
  if A.count(B[i])%2!=0:
    count+=1
print(count)

### FIXED CODE ###

n=int(input())
a=[int(input()) for i in range(n)]
d={}
for i in range(n):
  if a[i] in d:
    d[a[i]]+=1
  else:
    d[a[i]]=1
cnt=0
d=list(d.items())
for i in range(len(d)):
  if d[i][1]%2==1:
    cnt+=1
print(cnt)
### BUGGY CODE ###

import math, copy

N = int(input())

A = [0] * 5
A[0] = int(input())
A[1] = int(input())
A[2] = int(input())
A[3] = int(input())
A[4] = int(input())

# 最後に到着する人がかかる時間を求めればよい
# 乗り物に乗れる人数 < 最終グループの人数 が成り立つときに、遅延が発生
P = [0] * 6
Q = [0] * 6
P[0] = N
Q[0] = N
counter = 0

while P[5] != N:
	# print(P)
	# print("/////////")
	counter += 1
	# それぞれのマスiについて
	for i in range(5):
		if A[i] >= P[i]: # 移動できる人の数 >= 移動したい人の数
			Q[i + 1] += P[i] # iマス目にいた人をi + 1マス目に移す
			Q[i] -= P[i]
		else: # 遅延が発生
			move_num = A[i] #　このとき、次のマスに行けるのは、A[i]人だけ
			Q[i] -= A[i]
			Q[i + 1] += A[i]
	P = copy.deepcopy(Q) # 状態を更新する
		
print(counter)


### FIXED CODE ###

import math, copy

N = int(input())

A = [0] * 5
A[0] = int(input())
A[1] = int(input())
A[2] = int(input())
A[3] = int(input())
A[4] = int(input())

print(math.ceil(N / min(A) + 4))
### BUGGY CODE ###

h, w = map(int, input().split())
s = []
for _ in range(h):
    s.append(input())
hs = [[0]*w for _ in range(h)]
ws = [[0]*w for _ in range(h)]
for y in range(h):
    for x in range(w):
        if s[y][x] == ".":
            if 1<=x<w and ws[y][x-1]:
                ws[y][x] = ws[y][x-1]
                continue
            if x<w and s[y][x]==".":
                for x_ in range(x, w):
                    if s[y][x_] == ".": 
                        ws[y][x] += 1
                    else:
                        break
for x in range(w):
    for y in range(h):
        if s[y][x] == ".":
            if 1<=y<h and hs[y-1][x]:
                hs[y][x] = hs[y-1][x]
                continue
            if y<h and s[y][x]==".":
                for y_ in range(y, h):
                    if s[y_][x] == ".": 
                        hs[y][x] += 1
                    else:
                        break
ans = hs[0][0] + ws[0][0] -1 
for i in range(h):
    for j in range(w):
        ans = max(ans, hs[i][j] + ws[i][j] -1)
print(ans)

### FIXED CODE ###

h, w = map(int, input().split())
s = []
for _ in range(h):
    s.append(input())
hs = [[0]*w for _ in range(h)]
ws = [[0]*w for _ in range(h)]
for y in range(h):
    for x in range(w):
        if s[y][x] == ".":
            if 1<=x<w and ws[y][x-1]:
                ws[y][x] = ws[y][x-1]
                continue
            if x<w and s[y][x]==".":
                for x_ in range(x, w):
                    if s[y][x_] == ".": 
                        ws[y][x] += 1
                    else:
                        break
for x in range(w):
    for y in range(h):
        if s[y][x] == ".":
            if 1<=y<h and hs[y-1][x]:
                hs[y][x] = hs[y-1][x]
                continue
            if y<h and s[y][x]==".":
                for y_ in range(y, h):
                    if s[y_][x] == ".": 
                        hs[y][x] += 1
                    else:
                        break
ans = hs[0][0] + ws[0][0] -1 
for i in range(h):
    for j in range(w):
        ans = max(ans, hs[i][j] + ws[i][j] -1)
print(ans)
### BUGGY CODE ###

from fractions import gcd


def lcm(a, b):
    return a * b / gcd(a, b)


MOD = 10**9+7
N = int(input())
A = list(map(int, input().split()))

l = 1
for a in A:
    l = lcm(l, a)

ans = 0
for a in A:
    ans += l // a
    ans %= MOD

print(int(ans))



### FIXED CODE ###

from fractions import gcd

mod = 10 ** 9 + 7

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

lcm = 1
for s in A:
    lcm = s * lcm // gcd(lcm, s)

ans = lcm * sum([pow(s, mod - 2, mod) for s in A]) % mod

print(int(ans % mod))
### BUGGY CODE ###

inp = list(map(int, input().split()))

#print(inp)
s = inp[0]
c = inp[1]

ans = 0
while(s>0):
    if s*2 <= c:
        ans += s
        c -= 2*s
        s = 0
        if c>=4:
            ans += c//4
    else:
        if c>=4:
            s += 1
            c -= 4


print (ans)


### FIXED CODE ###

inp = list(map(int, input().split()))

#print(inp)
s = inp[0]
c = inp[1]

ans = 0
if s*2 <= c:
    ans += s
    c -= 2*s
    s = 0
    if c>=4:
        ans += c//4
elif c//2<=s:
        ans += c//2
        s -= c//2
        c -= 0
else:
    if c>=4:
        ans += c//4



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

import sys

input = sys.stdin.readline

def main():
    bc = 0
    h, w, m = map(int, input().split())
    bh = [0]*h
    bw = [0]*w
    b = []
    for _ in range(m):
        ht, wt = map(int, input().split())
        bh[ht-1] += 1
        bw[wt-1] += 1
        b.append([ht,wt])
    bc = max(bh) + max(bw)

    mbh = max(bh)
    mbw = max(bw)
    bhindxes = [i for i, x in enumerate(bh) if x == mbh]
    bwindxes = [i for i, x in enumerate(bw) if x == mbw]
    mb = 0
    tmpmb = 0
    ans = [0,0]
    for mh in bhindxes:
        for mw in bwindxes:
            tmpmb = bh[mh]
            if [mh+1, mw+1] not in b:
                tmpmb += bw[mw]
            if mb < tmpmb:
                ans = [mh, mw]
                mb = tmpmb
    if  [ans[0]+1, ans[1]+1] in b:
        bc -= 1
    print(bc)

if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys

input = sys.stdin.readline

def main():
    ans = 0
    H, W, M = map(int, input().split())
    bombs = []
    hs = [0]*(H)
    ws = [0]*(W)
    for _ in range(M):
        h, w = map(int, input().split())
        bombs.append(tuple([h-1, w-1]))
        hs[h-1] += 1
        ws[w-1] += 1
    maxh = max(hs)
    maxw = max(ws)
    ans = maxh + maxw

    maxhindex = [i for i, x in enumerate(hs) if x == maxh]
    maxwindex = [i for i, x in enumerate(ws) if x == maxw]

    isfound = False

    bombs = set(bombs)
    for i in maxhindex:
        for j in maxwindex:
            if (i, j) not in bombs:
                print(ans)
                exit()

    print(ans-1)

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

n = int(input())
sl = list(input())
ans = 0
for i in range(1000):
    try:
        i_zero = str(i)
        i_zero = i_zero.zfill(3)
        for j1,s in  enumerate (sl):
            if s == i_zero[0]:
                for j2,s in enumerate(sl[j1+1:],j1+1):
                    if s == i_zero[1]:
                        for j3,s in enumerate(sl[j2+1:],j2+1):
                            if s == i_zero[2]:
                                ans += 1
                                break
                        break
                break
    except:
        pass
print(ans)

### FIXED CODE ###

n = input()
sl = input()
ans = 0
for i in range(1000):
    i_zero = str(i)
    i_zero = i_zero.zfill(3)
    if i_zero[0] in sl:
        a = sl.index(i_zero[0])+1
        if i_zero[1] in sl[a:]:
            a = sl[a:].index(i_zero[1])+a+1
            if i_zero[2] in sl[a:]:
                ans += 1
print(ans)
### BUGGY CODE ###

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

first,last = map(int,input().split(" "))
set_cnt = set()
for i in range(first,last+1):
  set_cnt.add(i)


for m in range(M-1):
  _first, _last = map(int,input().split(" "))
  _set_cnt = set()
  for _ in range(_first,_last+1):
    _set_cnt.add(_)
  
  set_cnt = set_cnt & _set_cnt

print(len(set_cnt))

### FIXED CODE ###

N,M = map(int, input().split())
min_set_cnt,max_set_cnt = map(int,input().split(" "))

for m in range(M-1):
  _first, _last = map(int,input().split(" "))
  min_set_cnt = max(min_set_cnt,_first)
  max_set_cnt = min(max_set_cnt,_last)


ans = max(max_set_cnt - min_set_cnt + 1, 0)

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

import itertools
n = int(input())
l = [int(x) for x in input().split()]

ans = 0
for v in itertools.combinations(l, 3):
    if v[0] < v[1] + v[2] and v[1] < v[0]+v[2] and v[2] < v[0]+v[1]:
        ans += 1

print(ans)

### FIXED CODE ###

from bisect import bisect_left
n = int(input())
l = [int(x) for x in input().split()]
l.sort()
x = 0

for i in range(n):
    for j in range(i+1, n):
        a = l[i] + l[j]
        x += max(bisect_left(l,a) - j - 1, 0)
print(x)