Harryxun/stf_run huggingface dataset:
# abc 152 e
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)

from collections import defaultdict

N = int(readline().rstrip())
al = list(map(int, readline().split()))

# 最大公約数
from fractions import gcd

# 最小公倍数
def lcm(a, b):
    return a * b // gcd(a, b)

lcm_ = 0
for a in al:
    if lcm_ == 0:
        lcm_ = a
        continue
    lcm_ = lcm(a, lcm_)

prime = 10 ** 9 + 7
bl = []
for a in al:
    b = int(lcm_ / a)
    bl.append(b)

answer = sum(bl) % prime
print(answer)

### FIXED CODE ###

# abc 152 e
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)

MOD = 10 ** 9 + 7

N = int(readline().strip())
A = list(map(int, readline().split()))

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

lcm_ = 1  # 倍数を出したいので初期値は1
for i in range(N):
    lcm_ = lcm(lcm_, A[i])

ans = 0
for i in range(N):
    ans += lcm_ * pow(A[i], MOD-2, MOD)

print(ans % MOD)
n = int(input())
d = {}
for i in range(n):
  s = input()
  if s not in d:d[s] = 0
  d[s] += 1
max_cnt = sorted(d.items(), key=lambda tp:tp[1])[-1][1]
a1 = filter(lambda tp:tp[1] == max_cnt, d.items())
a2 = map(lambda tp:tp[0], a1)
for s in sorted(a2):
  print(s)


### FIXED CODE ###

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

if (a==b and c!= a) or (a==c and a!=b) or (b == c and a!=b):print('Yes')
else:print('No')
N, L, T = list(map(int, input().split()))

X = []
W = []
X_after = []
for _ in range(N):
    x, w = list(map(int, input().split()))
    if w == 1:
        x_after = (x + T) % L
    else:
        x_after = (x - T) % L

    if x_after < 0:
        x_after = L + x_after

    X.append(x)
    W.append(w)
    X_after.append(x_after)

n_colide = 0
for i in range(1, N):
    if W[0] == 1 and W[i] == 2:
        dist = X[i] - X[0]
        n_colide += 2 * (T - (dist / 2)) // L + 1
    elif W[0] == 2 and W[i] == 1:
        dist = (L + X[0]) - X[i]
        n_colide += 2 * (T - (dist / 2)) // L + 1

if W[0] == 1:
    num_after = W[0] + (N % n_colide)
else:
    num_after = W[0] - (N % n_colide)
    num_after = num_after if num_after >= 0 else L + num_after

num_after = int(num_after)

last_info = [
    {"X": X_after[0], "num": num_after}
]
x_after_first = X_after[0]
X_after = sorted(X_after)
i = X_after.index(x_after_first)
X_after = X_after[i:] + X_after[:i]

for i in range(1, N):
    num = num_after + i
    if num >= N:
        num = N - num
    last_info.append({
        "X": X_after[i],
        "num": num,
    })

sorted_info = sorted(last_info, key=lambda info: info["num"])

for info in sorted_info:
    print(info["X"])


### FIXED CODE ###

N, L, T = list(map(int, input().split()))

X = []
W = []
X_after = []
for _ in range(N):
    x, w = list(map(int, input().split()))
    if w == 1:
        x_a = (x + T) % L
    else:
        x_a = (x - T) % L
        x_a = x_a if x_a >= 0 else L + x_a
    X.append(x)
    W.append(w)
    X_after.append(x_a)

n_colide = 0
for i in range(1, N):
    if W[0] == 1 and W[i] == 2:
        dist = X[i] - X[0]
        n_colide += 2 * (T - (dist / 2)) // L + 1
    elif W[0] == 2 and W[i] == 1:
        dist = (L + X[0]) - X[i]
        n_colide += 2 * (T - (dist / 2)) // L + 1

if W[0] == 1:
    num_a0 = n_colide % N
else:
    num_a0 = N - (n_colide % N)

num_a0 = int(num_a0)

x_a0 = X_after[0]
X_after = sorted(X_after)
i = X_after.index(x_a0)
if W[0] == 1 and X_after.count(x_a0) == 2:
    i += 1
X_after = X_after[i-num_a0:] + X_after[:i-num_a0]

for x_a in X_after:
    print(x_a)
from operator import itemgetter

N = int(input())


A = []
for i in range(N - 1):
    A.append([int(i) for i in input().split()])

print("==")

B = []
for row in A:
    B.append(sorted(row))
B.sort(key = itemgetter(0))

link_list = [[] for i in range(N)]
for row in B:
    link_list[row[0] - 1].append(row[1] - 1)
    link_list[row[1] - 1].append(row[0] - 1)
edge_color = dict()
marker = [0] * N

def DFS_color(node, pre_color):
    target_list = link_list[node]
    print(target_list, node)
    color = 1
    for ko_node in target_list:
        if marker[ko_node] == 0:
            if pre_color == color:
                color += 1
            edge_color[node, ko_node] = color
            edge_color[ko_node, node] = color 
            print(node, ko_node, color)
            marker[ko_node] = 1
            DFS_color(ko_node, color)
            color += 1
        else:
            pass

marker[0] = 1
DFS_color(0, 0)

print(max(edge_color.values()))
for node1, node2 in A:
    print(edge_color[node1 - 1, node2 - 1])

### FIXED CODE ###

from operator import itemgetter
import sys
sys.setrecursionlimit(10**7)

N = int(input())


A = []
for i in range(N - 1):
    A.append([int(i)-1 for i in input().split()])

B = []
for row in A:
    B.append(sorted(row))
B.sort(key = itemgetter(0))

link_list = [[] for i in range(N)]
for row in B:
    link_list[row[0]].append(row[1])
    link_list[row[1]].append(row[0])
edge_color = dict()
marker = [0] * N


def DFS_color(node, pre_color):
    target_list = link_list[node]
    color = 1
    for ko_node in target_list:
        if marker[ko_node] == 0:
            if pre_color == color:
                color += 1
            edge_color[node, ko_node] = color
            edge_color[ko_node, node] = color 
            marker[ko_node] = 1
            DFS_color(ko_node, color)
            color += 1
        else:
            pass

marker[0] = 1
DFS_color(0, 0)

print(max(edge_color.values()))
for node1, node2 in A:
    print(edge_color[node1, node2])
X, Y, A, B, C = [int(i) for i in input().split()]
p = [int(i) for i in input().split()]
q = [int(i) for i in input().split()]
r = [int(i) for i in input().split()]
p.sort()
q.sort()
r.sort(reverse=True)
p = p[A - X:]
q = q[B - Y:]
pi = 0
qi = 0
for v in r:
    if p[pi] < v or q[qi] < v:
        if p[pi] < q[qi]:
            p[pi] = v
            pi = min(pi + 1, A - 1)
        else:
            q[qi] = v
            qi = min(qi + 1, B - 1)
    else:
        break
print(sum(p) + sum(q))

### FIXED CODE ###

X, Y, A, B, C = [int(i) for i in input().split()]
p = [int(i) for i in input().split()]
q = [int(i) for i in input().split()]
r = [int(i) for i in input().split()]
p.sort()
q.sort()
r.sort(reverse=True)
p = p[A - X:]
q = q[B - Y:]
pi = 0
qi = 0
for v in r:
    if p[pi] < v or q[qi] < v:
        if p[pi] < q[qi]:
            p[pi] = v
            pi = min(pi + 1, X - 1)
        else:
            q[qi] = v
            qi = min(qi + 1, Y - 1)
    else:
        break
print(sum(p) + sum(q))
N, M =map(int,input().split())
cards = list(map(int,input().split()))
card_pool = [list(map(int,input().split())) for _ in range(M)]
cards.sort()
#print(cards)
card_pool.sort(key=lambda x:x[1],reverse=True)
#print(card_pool)


ruisekiwa = 0
idx = 0
for i in range(M):
    for j in range(card_pool[i][0]):
        if card_pool[i][1] <= cards[idx]:
            break
        ruisekiwa += card_pool[i][1]
        idx += 1
        if idx == N:
            break
print(sum(cards[idx:])+ruisekiwa)



### FIXED CODE ###

N,M = map(int,input().split())
*A, = map(int,input().split())
BC=[list(map(int,input().split())) for _ in [0]*M]
A.sort()
BC.sort(key=lambda x:-x[1])
i = 0
for B,C in BC:
    for j in range(i,min(N,i+B)):
        if A[j]<C:A[j]=C
    i = i+B
print(sum(A))
n = int(input())
for i in range(111,999,111):
    if i< n < i+111:
        ans = i + 111
        break
print(int(ans))


### FIXED CODE ###

n = int(input())
if (n % 111) == 0:
	ans = (n // 111) * 111
else:
	ans = (n // 111 +1) * 111
print(int(ans))
import sys
import math
import bisect
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop


def LI(): return [int(x) for x in sys.stdin.readline().split()]


def I(): return int(sys.stdin.readline())


def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res


def IR(n):
    return [I() for i in range(n)]


# A
def A():
    s = input()
    if s == 'SUN':
        print(7)
    if s == "MON":
        print(6)
    if s == "TUE":
        print(5)
    if s == "WED":
        print(4)
    if s == "THU":
        print(3)
    if s == "FRI":
        print(2)
    if s == "SAT":
        print(1)
    return


# B
def B():
    al = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
    n = I()
    s = S()
    for i in range(len(s)):
        ni = (al.index(s[i]) + n) % 26
        s[i] = al[ni]
    print(''.join(s))
    return


# C
def C():
    a, b, x = LI()
    l = [a * (10 ** (i - 1)) + b * i for i in range(1, 11)]
    p = 0
    for i in range(10):
        if x < l[i] and i == 0:
            print(0)
            return
        if l[i] <= x and i == 9:
            print(10 ** 9)
            return
        elif l[i] <= x < l[i + 1]:
            p = i + 1
            break
    if (x - b * p) // a >= 10 ** p:
        print(10 ** p - 1)
    else:
        print((x - b * p) // a)
    return


# D
def D():
    return


# E
def E():
    return


# F
def F():
    return


# Unittest
def resolve():
    C()

    return


# Solve
if __name__ == "__main__":
    C()


### FIXED CODE ###

import sys
import math
import bisect
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop


def LI(): return [int(x) for x in sys.stdin.readline().split()]


def I(): return int(sys.stdin.readline())


def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res


def IR(n):
    return [I() for i in range(n)]


# A
def A():
    s=input()
    if s=='SUN':
        print(7)
    if s=="MON":
        print(6)
    if s=="TUE":
        print(5)
    if s=="WED":
        print(4)
    if s=="THU":
        print(3)
    if s=="FRI":
        print(2)
    if s=="SAT":
        print(1)
    return


# B
def B():
    return


# C
def C():
    return


# D
def D():
    return


# E
def E():
    return


# F
def F():
    return


# Unittest
def resolve():
    A()
    return


# Solve
if __name__ == "__main__":
    A()
# -*- coding: utf-8 -*-
N, Y = map(int, input().split())

a = 0
for x in range(N+1): 
    for y in range(N-x+1):
        if (10000*x + 5000*y + 1000*(N-x-y)) == Y:
            print(str(x)+" "+str(y)+" "+str(N-x-y))
            a = 1
            break
        if a == 1:
            break
    if a == 1:
        break

if a != 1:
    print("-1 -1 -1")

### FIXED CODE ###

a = input()
b = a.split("/")
b[0] = "2018"

c = ""
c = "/".join(b)
print(c)
a, b, k = map(int, input().split())

if b - a <= 2*k - 1:
  print(*range(a, b+1))
else:
  print(*range(a, a+k))
  print(*range(b-k+1, b+1)

### FIXED CODE ###

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

if b - a <= 2*k - 1:
  print(*range(a, b+1), sep="\n")
else:
  print(*range(a, a+k), sep="\n")
  print(*range(b-k+1, b+1), sep="\n")
n = int(input())
XY = []
for i in range(n):
    a = int(input())
    xy = []
    for j in range(a):
        x, y = map(int, input().split())
        xy.append([x, y])
    XY.append(xy)
ans = 0
for i in range(2 ** n):
    s = [0] * n
    cnt = 0
    case = 0
    for j in range(n):
        if (i >> j) & 1:
            s[n - 1 - j] = 1
            cnt += 1
    for k in range(n):
        if s[k] == 1:
            for l in range(len(XY[l])):
                if s[XY[k][l][0] - 1] != XY[k][l][1]:
                    case = 1
    if case == 0:
        ans = max(ans, cnt)
print(ans)

### FIXED CODE ###

n = int(input())
XY = []
for i in range(n):
    a = int(input())
    xy = []
    for j in range(a):
        x, y = map(int, input().split())
        xy.append([x, y])
    XY.append(xy)
ans = 0
for i in range(2 ** n):
    s = [0] * n
    cnt = 0
    case = 0
    for j in range(n):
        if (i >> j) & 1:
            s[n - 1 - j] = 1
            cnt += 1
    for k in range(n):
        if s[k] == 1:
            for l in range(len(XY[k])):
                if s[XY[k][l][0] - 1] != XY[k][l][1]:
                    case = 1
    if case == 0:
        ans = max(ans, cnt)
print(ans)
import sys
import fractions

n=int(input())
list=[]
count=1
ans=1
for i in range(n):
	t=int(input())
	if not t in list:
		list.append(t)
		count*=t
		ans = fractions.gcd(ans, list[i])
print(count//ans)

### FIXED CODE ###

import sys
import fractions

n=int(input())
list=[]
ans=1
for i in range(n):
	t=int(input())
	list.append(t)
	ans =ans * list[i] // fractions.gcd(ans, list[i])
print(ans)
from bisect import bisect_left
def main():
  n,h=map(int,input().split())
  a=[None]*n
  b=a[:]
  ans=0
  for i in range(n):
    a[i],b[i]=map(int,input().split())
  m=max(a)
  b=sorted(b,reverse=True)
  x=bisect_left(b,m)
  for i in b[:n]:
    h-=i
    ans+=1
    if h<=0:
      print(ans)
      return
  ans+=(h+m-1)//m
  print(ans)
main()

### FIXED CODE ###

print(input().replace("7/","8/"))
import math

[N, M] = list(map(int, input().split()))
num = math.ceil(M / N)
if N > 1:
    num = min(num, int(math.sqrt(M+1)))
for i in range(num+1)[::-1]:
    if M % i == 0:
        print(i)
        break

### FIXED CODE ###

N = int(input())
if N == 1:
    print('Hello World')
elif N == 2:
    A = int(input())
    B = int(input())
    print(A+B)
# a, b = (int(i) for i in input().split())
a = int(input())
b = int(input())

if a <= 8 and b <= 8:
    print('Yay!')
else:
    print(':(')


### FIXED CODE ###

a, b = (int(i) for i in input().split())

if a <= 8 and b <= 8:
    print('Yay!')
else:
    print(':(')
import math
def main():
    H = int(input())
    t = int(math.log2(H))
    r = 2**(t + 1) - 1
    print(r)
main()
    


### FIXED CODE ###

import math
def main():
    H = int(input())
    t = int(math.log2(H))
    r = 2**(t + 1) - 1
    print(r)
main()
import sys
input = sys.stdin.readline

_x, _y = map(int, input().split())


def modinv(a, mod=10**9 + 7):
    return pow(a, mod - 2, mod)


def combination(n, r, mod=10**9 + 7):
    r = min(r, n - r)
    res = 1
    for i in range(r):
        res = res * (n - i) * modinv(i + 1, mod) % mod
    return res


def chker(x, y):
    if x == y:
        if x % 3 != 0:
            print(0)
            return

        b = x // 3
        print(combination(2 * b, b))
        return

    x, y = (x, y) if x > y else (y, x)

    b = y - x / 2
    if 2 * b % 3 != 0:
        print(0)
        return

    d1, d2 = 2 * b // 3, int(x / 2 - b / 3)
    u = d1 + d2

    print(combination(u, min(d1, d2)))


chker(_x, _y)


### FIXED CODE ###

import sys
input = sys.stdin.readline

_x, _y = map(int, input().split())


def nCk(n, k, m=10 ** 9 + 7):
    a = b = 1
    k = min(k, n - k)
    for i in range(k):
        a = (a * (n - i)) % m
        b = (b * (i + 1)) % m

    return (a * pow(b, m - 2, m)) % m


def chker(x, y):
    if (x + y) % 3 != 0 or x > 2 * y or y > 2 * x:
        print(0)
        return

    if x == y:
        b = x // 3
        print(nCk(2 * b, b))
        return

    x, y = (x, y) if x < y else (y, x)

    b = 2 * x - y
    if b % 3 != 0:
        print(0)
        return

    d1, d2 = b // 3, x - 2 * (b // 3)
    u = d1 + d2

    print(nCk(u, d1))


chker(_x, _y)
N = int(input())
cnt = 0
L = [list(map(int, input().split())) for x in range(N)]
for a, b in L[::-1]:
    a += cnt
    if a < b && a != 0 : cnt += b - a
    if a > b: 
        if a % b:
            cnt += b - a % b
        else:
            cnt += a % b
print(cnt)

### FIXED CODE ###

N = int(input())
cnt = 0
L = [list(map(int, input().split())) for x in range(N)]
for a, b in L[::-1]:
    a += cnt
    if a < b and a != 0 : cnt += b - a
    if a > b: 
        if a % b:
            cnt += b - a % b
        else:
            cnt += a % b
print(cnt)
#!/usr/bin/env python3
N, M = map(int, input().split())
AB = [list(map(int, input().split())), for i in range(N)]

AB.sort()

ans = 0
for i, j in AB
	ans += i * min(M, j)
	M -= min(M, j)

print(ans)


### FIXED CODE ###

#!/usr/bin/env python3
N, M = map(int, input().split())
AB = [list(map(int, input().split())) for i in range(N)]

AB.sort()

ans = 0
for i, j in AB:
	ans += i * min(M, j)
	M -= min(M, j)

print(ans)
def main():
    num = int(input())
    gg = ((
        (quotient := num // divisor) + 1) * quotient * divisor // 2
        for divisor in range(1, num + 1))
    print(sum(gg))


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    num = int(input())
    ans = 0

    for divisor in range(1, num + 1):
        quotient = num // divisor
        ans += (quotient + 1) * quotient * divisor // 2

    print(ans)


if __name__ == '__main__':
    main()
x, n = map(int, input().split())
if n == 0:
    print(x)
    exit(0)
a = [int(x) for x in input().split()]
b = [i for i in range(1,101) if i not in a]
b_tmp = list(map(lambda s:abs(s-x), b))
mnum = min(b_tmp)
address = b_tmp.index(mnum)
print(b[address])

### FIXED CODE ###

x, n = map(int, input().split())
a = [int(x) for x in input().split()]
b = [i for i in range(0,102) if i not in a] 
b_tmp = list(map(lambda s:abs(s-x), b)) #b_tmpはbとxの差分のリストをさくせい
address = b_tmp.index(min(b_tmp))
print(b[address])
import sys
input = sys.stdin.readline

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

A = [list(map(int,input().split())) for i in range(H)]
B = [list(map(int,input().split())) for i in range(H)]

C = [[0]*W for i in range(H)]

for h in range(H):
    for w in range(W):
        C[h][w] = abs(A[h][w] - B[h][w])
        
#print(C)

ZZZ = 80*73

DP = [[[0]*ZZZ for i in range(W)] for j in range(H)]

for j in range(H):
    for w in range(W):
        if h==0 and w==0:
            DP[h][w][C[h][w]] = 1
        elif h==0:
            for i in range(ZZZ):
                DP[h][w][i] = DP[h][w-1][abs(i-C[h][w])]| (DP[h][w-1][abs(i+C[h][w])] if abs(i+C[h][w])<ZZZ else 0)
        elif w==0:
            for i in range(ZZZ):
                DP[h][w][i] = DP[h-1][w][abs(i-C[h][w])]|(DP[h-1][w][abs(i+C[h][w])] if abs(i+C[h][w])<ZZZ else 0)
        else:
            for i in range(ZZZ):
                DP[h][w][i] = DP[h-1][w][abs(i-C[h][w])]|(DP[h-1][w][abs(i+C[h][w])] if abs(i+C[h][w])<ZZZ else 0)|DP[h][w-1][abs(i-C[h][w])]|(DP[h][w-1][abs(i+C[h][w])] if abs(i+C[h][w])<ZZZ else 0)
                
for i in range(ZZZ):
    if DP[H-1][W-1][i]==1:
        ans = i
        break
print(ans)

### FIXED CODE ###

import sys
input = sys.stdin.readline

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

A = [list(map(int,input().split())) for i in range(H)]
B = [list(map(int,input().split())) for i in range(H)]

C = [[0]*W for i in range(H)]
M = 0

for h in range(H):
    for w in range(W):
        C[h][w] = abs(A[h][w] - B[h][w])
        
#print(C)

c = 80*(H+W-1)+1

DP = [[0]*W for j in range(H)]

for h in range(H):
    for w in range(W):
        if h==0 and w==0:
            DP[h][w] = 1 << (C[h][w]+c)
        elif h==0:
            DP[h][w] = (DP[h][w-1] << C[h][w]) | (DP[h][w-1] >> C[h][w])
        elif w==0:
            DP[h][w] = (DP[h-1][w] << C[h][w]) | (DP[h-1][w] >> C[h][w])
        else:
            DP[h][w] = (DP[h][w-1] << C[h][w]) | (DP[h][w-1] >> C[h][w]) | (DP[h-1][w] << C[h][w]) | (DP[h-1][w] >> C[h][w])

ans = float('inf')
now = DP[H-1][W-1]
tmpans = -c
while now != 0:
    if now%2==1:
        ans = min(ans,abs(tmpans))
    tmpans += 1
    now = now >> 1

print(ans)
x, y = int(input(),16), int(input(),16)
print("="if x==y else "<"if x<y else">")

### FIXED CODE ###

def c(x):
  return int(x,16)

x, y = map(str,input().split())
x, y = c(x), c(y)
print("="if x==y else"<"if x<y else">")
# ｎとｍの取得
data = input().split()
n = int(data[0]) #n == 人数
m = int(data[1]) #m == 数字の種類
ans = 0
#ｎ回データを取得してカウント

j = 1 #j == 好きな数字
i = 1 #i == 行数カウンタ
c = [0] * m #c == ある数が含まれているかのカウンタ　0で初期化
    #データの取得

while i <= n:
    tmp = input()
    td = tmp[1:] #td == 好きな番号
    tn = tmp[0]  #tn == 好きな番号の数
    
    # 数字が含まれているかの比較
    while j <= m: # jがすべての数字について実行
        j = str(j)# jを文字列に変換
        if j in td: # jがｔｄに含まれるかの分岐
            j = int(j) #　ｊを数値に戻す
            c[j] += 1 # ｃのｊ番目の要素にカウント
        j = int(j) #if ではじかれたとき用にｊを数値に戻す
        j += 1# ｊをカウント
    j = 1    
    i += 1 # iをカウント

# 全てに含まれている数字の集計

for x in c:
    if x == n:
        ans += 1



print(ans)


### FIXED CODE ###

# ｎとｍの取得
data = input().split()
n = int(data[0]) #n == 人数
m = int(data[1]) #m == 数字の種類
ans = 0
#ｎ回データを取得してカウント

j = 1 #j == 好きな数字
i = 1 #i == 行数カウンタ
c = [0] * (m  *2)#c == ある数が含まれているかのカウンタ　0で初期化
    #データの取得

while i <= n:
    tmp = [int(s) for s in input().split()]
    td = tmp[1:] #td == 好きな番号
    tn = tmp[0]  #tn == 好きな番号の数
    
    # 数字が含まれているかの比較
    while j <= m: # jがすべての数字について実行
        
        if j in td: # jがｔｄに含まれるかの分岐
            j = int(j) #　ｊを数値に戻す
            
            c[j] += 1 # ｃのｊ番目の要素にカウント
        j = int(j) #if ではじかれたとき用にｊを数値に戻す
        j += 1# ｊをカウント
    j = 1    
    i += 1 # iをカウント

# 全てに含まれている数字の集計

for x in c:
    if x == n:
        ans += 1



print(ans)
from collections import Counter

N = int(input())

strings = [input() for i i in range(N)]

string_set = list(map(set,strings))
count_set = list(map(Counter, strings))

common_letter = string_set[0]

for s in string_set:
    common_letter = common_letter & s

common_letter_nums = {}

for l in common_letter:
    common_letter_nums.setdefault(l, [])
    for c in count_set:
        common_letter_nums[l].append(c[l])

output_letter = ''
for k, v in common_letter_nums.items():
    output_letter += k * min(v)

print(''.join(sorted(output_letter)))

### FIXED CODE ###

from collections import Counter

N = int(input())

strings = [input() for i in range(N)]

string_set = list(map(set,strings))
count_set = list(map(Counter, strings))

common_letter = string_set[0]

for s in string_set:
    common_letter = common_letter & s

common_letter_nums = {}

for l in common_letter:
    common_letter_nums.setdefault(l, [])
    for c in count_set:
        common_letter_nums[l].append(c[l])

output_letter = ''
for k, v in common_letter_nums.items():
    output_letter += k * min(v)

print(''.join(sorted(output_letter)))
n = input()
d = dict()
for i in range(n):
  w = raw_input()
  if w in d:
    d[w] += 1
  else:
    d[w] = 1
di = d.items()
def com(a,b):
  if a[1] > b[1]:
    return True
  elif a[1] == b[1]:
    return a[0]>b[0]
  else:
    return False
di = sorted(di, cmp=com)
print(di[0][0])
if len(di) > 1:
  print(di[1][0])

### FIXED CODE ###

d = raw_input()
a, b, c =  d.split()
a = int(a)
b = int(b)
c = int(c)
if (a==b):
  if c == a:
    print("No")
  else:
    print("Yes")
else:
  if a==c or b == c:
    print("Yes")
  else:
    print("No")
import sys
l=int(input())
x=l/3
ans=0
print(f"{x*x*x:0.6f}")
sys.exit()
for i in [x-1,x,x+1]:
    for j in [x-1,x,x+1]:
        for k in [x-1,x,x+1]:
            if i+j+k==l:
                ans=max(ans,i*j*k)
print(ans)


### FIXED CODE ###

l=float(input())

x=l/3
print((l/3)**3)
#print(f"{x*x*x:0.6f}")
a, b, c, d = map(int, inmput().split())

x = abs(a - b)
y = abs(b - c)
z = abs(c - a)

if z <= d:
  print('Yes')
elif if x<= d and y <= d:
  print('Yes')
else:
  print('No')


### FIXED CODE ###

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

x = abs(a - b)
y = abs(b - c)
z = abs(c - a)

if z <= d:
  print('Yes')
elif x<= d and y <= d:
  print('Yes')
else:
  print('No')
import random
S = input()
rand = random.randrange(0, len(S) - 1)
print(S[rand] + S[rand + 1] + S[rand + 2])


### FIXED CODE ###

import random
S = input()
rand = random.randrange(0, len(S) - 2)
print(S[rand] + S[rand + 1] + S[rand + 2])
S = input()
T = input()
k = len(T)
m = 0
for i in range(k):
  if S[k] == T[k]:
    m = m
  else:
    S[k] = T[k]
    m += 1
print(m)

### FIXED CODE ###

S = input()
T = input()
k = len(T)
m = 0
for i in range(k):
  if S[i] != T[i]:
    m += 1
print(m)
s = input()
k = int(input())
n = len(list(s))
kouho = set()
for i in range(n):
    for d in range(1, k + 1):
        if i + d < n:
            kouho.add(s[i : i + d])
ans = list(kouho)
ans.sort()
print(ans[k - 1])


### FIXED CODE ###

s = input()
k = int(input())
n = len(list(s))
kouho = set()
for i in range(n):
    for d in range(1, k + 1):
        if i + d <= n:
            kouho.add(s[i : i + d])
ans = list(kouho)
ans.sort()
# print(ans)
print(ans[k - 1])