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

import collections

n = int(input())
s = [collections.Counter(input()) for _ in range(n)]
ans = 0

for i, e1 in enumerate(s):
    for e2 in s[i+1:]:
        if e1 == e2:
            ans += 1

print(ans)


### FIXED CODE ###

n = int(input())
s = {}
ans = 0

for i in range(n):
    e = ''.join(sorted(input()))
    s[e] = s.get(e, 0) + 1

for e in s.values():
    ans += e*(e-1) // 2
print(ans)
### BUGGY CODE ###

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

timeleft = K
counter = 0

flag = True
while flag:
    if len(A) == 0 and len(B) == 0:
        flag = False
    elif len(A) == 0:
        if B[0] <= timeleft:
            counter += 1
            timeleft -= B[0]
            B.pop(0)
        else:
            flag = False
    elif len(B) == 0:
        if A[0] <= timeleft:
            counter += 1
            timeleft -= A[0]
            A.pop(0)
        else:
            flag = False
    elif len(A) == 1 and len(B) == 1:
        if A[0] < B[0]:
            if A[0] <= timeleft:
                counter += 1
                timeleft -= A[0]
                A.pop(0)
            else:
                flag = False
        else:
            if B[0] <= timeleft:
                counter += 1
                timeleft -= B[0]
                B.pop(0)
            else:
                flag = False
    elif len(A) == 1:
        if A[0] < B[0]:
            if A[0] <= timeleft:
                counter += 1
                timeleft -= A[0]
                A.pop(0)
            else:
                flag = False
        else:
            if B[0] <= timeleft:
                counter += 1
                timeleft -= B[0]
                B.pop(0)
            else:
                flag = False
    elif len(B) == 1:
        if B[0] < A[0]:
            if B[0] <= timeleft:
                counter += 1
                timeleft -= B[0]
                B.pop(0)
            else:
                flag = False
        else:
            if A[0] <= timeleft:
                counter += 1
                timeleft -= A[0]
                A.pop(0)
            else:
                flag = False 
    else:
        if A[0] < B[0]:
            if B[0] <= timeleft:
                if A[0] + A[1] < B[0] + B[1]:
                    timeleft -= A[0]
                    counter += 1
                    A.pop(0)
                else:
                    timeleft -= B[0]
                    counter += 1
                    B.pop(0)
            elif A[0] <= timeleft:
                timeleft -= A[0]
                counter += 1
                A.pop(0)
            else:
                flag = False
        else:
            if A[0] <= timeleft:
                if B[0] + B[1] < A[0] + A[1]:
                    timeleft -= B[0]
                    counter += 1
                    B.pop(0)
                else:
                    timeleft -= A[0]
                    counter += 1
                    A.pop(0)
            elif B[0] <= timeleft:
                timeleft -= B[0]
                counter += 1
                B.pop(0)
            else:
                flag = False
print(counter)

### FIXED CODE ###

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

Asum = [0]
Bsum = [0]
atemp = 0
btemp = 0
for i in range(N):
    atemp += A[i]
    Asum.append(atemp)
for i in range(M):
    btemp += B[i]
    Bsum.append(btemp)

ans = 0
j = M
for i in range(N+1):
    if Asum[i] > K:
        break
    while Asum[i] + Bsum[j] > K:
        j -= 1
    ans = max(ans, i+j)

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

import itertools

N = int(input())

# ここで、七五三数とは以下の条件を満たす正の整数です。
# 十進法で表記したとき、数字 7, 5, 3 がそれぞれ 1 回以上現れ、これら以外の数字は現れない。

ans = 0
for i in range(1, N + 1):
    i = str(i)
    if ("3" in i) and ("5" in i) and ("7"in i):
        if ("1" not in i) and ("2" not in i) and ("4" not in i) and ("6" not in i) and ("8" not in i) and ("9" not in i) and ("0" not in i):
            ans += 1

print(ans)


### FIXED CODE ###

N = int(input())

# ここで、七五三数とは以下の条件を満たす正の整数です。
# 十進法で表記したとき、数字 7, 5, 3 がそれぞれ 1 回以上現れ、これら以外の数字は現れない。


def dfs(s):
    if int(s) > N:
        return 0

    ret = 1 if all(s.count(c) > 0 for c in '753') else 0

    for c in '753':
        ret += dfs(s + c)
    return ret


print(dfs('0'))
### BUGGY CODE ###

n=int(input())
table=sorted(list(map(int,input().split())))
for i in range(n):
    for j in range(n):
        if (table[i]==table[j]) and (i!=j) :
            print("NO")
            exit()
print("YES")


### FIXED CODE ###

n=int(input())
table=sorted(list(map(int,input().split())))
for i in range(n-1):
    if table[i]==table[i+1]:
        print("NO")
        exit()
print("YES")
### BUGGY CODE ###

N, M = map(int, input().split())
flg = [0] * N

for _ in range(M):
    L, R = map(int, input().split())
    for i in range(L - 1, R):
        flg[i] += 1

ans = 0
for j in range(N):
    if flg[j] == M:
        ans += 1

print(ans)

### FIXED CODE ###

def INT():
    return int(input())

def LI():
    return list(map(int, input().split()))

def MI():
    return map(int, input().split())

N, M = MI()
gate = [0] * (N + 2)
ans = 0

for _ in range(M):
    L, R = MI()
    gate[L] += 1
    gate[R + 1] -= 1

for i in range(1, N + 1):
    gate[i] += gate[i - 1]
    
for i in range(1, N + 1):
    if gate[i] == M:
        ans += 1
        
print(ans)
### BUGGY CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

# 素因数分解
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])
    if temp != 1:
        arr.append([temp, 1])
    if arr == []:
        arr.append([n, 1])
    return arr

n, *a = map(int, read().split())

ans = 0
for x in a:
    arr = factorization(x)
    for y in arr:
        if y[0] == 2:
            ans += y[1]
print(ans)

### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n, *a = map(int, read().split())

ans = 0
for x in a:
    while x % 2 == 0:
        x = x // 2
        ans += 1

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

import sys
from collections import deque

input = sys.stdin.readline

N = int(input())
nodes = deque()
for i in range(N - 1):
    nodes.append(list(map(int, input().split())))

B, W = set(), set()
u, v, w = nodes.popleft()
if w % 2 == 0:
    B.add(u)
    B.add(v)
else:
    B.add(u)
    W.add(v)

while len(nodes) != 0:
    u, v, w = nodes.popleft()
    if w % 2 == 0:
        if u in B or v in B:
            B.add(u)
            B.add(v)
        elif u in W or v in W:
            W.add(u)
            W.add(v)
        else:
            nodes.append([u, v, w])
    else:
        if u in B or v in W:
            B.add(u)
            W.add(v)
        elif u in W or v in B:
            W.add(u)
            B.add(v)
        else:
            nodes.append([u, v, w])

ans = [0] * N
for x in W:
    ans[x - 1] = 1
for x in ans:
    print(x)


### FIXED CODE ###

import sys
from collections import defaultdict

sys.setrecursionlimit(100000)
input = sys.stdin.readline

N = int(input())
G = defaultdict(list)
for _ in range(N - 1):
    u, v, w = map(int, input().split())
    G[u - 1].append((v - 1, w))
    G[v - 1].append((u - 1, w))
res = [None] * N


def dfs(v, c):
    res[v] = c
    for u, w in G[v]:
        if res[u] is not None:
            continue
        if w % 2 == 0:
            dfs(u, c)
        else:
            dfs(u, 1 - c)


dfs(0, 0)
for x in res:
    print(x)
### BUGGY CODE ###

def LI():
    return list(map(int, input().split()))


L, R = LI()
ans = 2020
for i in range(L, R+1):
    for j in range(i+1, R+1):
        y = (i*j) % 2019
        ans = min(ans, y)
        if ans == 0:
            break
print(ans)


### FIXED CODE ###

L, R = map(int, input().split())
R = min(R, L+4038)
ans = 2018
for i in range(L, R):
    for j in range(L+1, R+1):
        ans = min((i*j) % 2019, ans)
print(ans)
### BUGGY CODE ###

import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


n, m, k = map(int, input().split())
cmb = combinations_count(n * m - 2, k - 2)
ans = 0
for i in range(n):
    for j in range(i, n):
        if i < j:
            ans += abs(i - j) * cmb * m * m
            ans %= 10 ** 9 + 7

for i in range(m):
    for j in range(i, m):
        if i < j:
            ans += abs(i - j) * cmb * n * n
            ans %= 10 ** 9 + 7

print(ans % (10 ** 9 + 7))

### FIXED CODE ###

import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


n, m, k = map(int, input().split())
cmb = combinations_count(n * m - 2, k - 2)
cmb %= 10 ** 9 + 7
ans = 0
for i in range(1, n):
    ans += i * cmb * m * m * (n - i)
    ans %= 10 ** 9 + 7

for i in range(1, m):
    ans += i * cmb * n * n * (m - i)
    ans %= 10 ** 9 + 7

print(ans % (10 ** 9 + 7))
### BUGGY CODE ###

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

A.sort(reverse = True)
B.sort(reverse = True)
C.sort(reverse = True)

count = 0
for i in range(N):
    j = 0
    flag1 = True
    while flag1:
        if A[i] < B[j]:
            flag2 = True
            k = 0
            while flag2:
                if B[j] < C[k]:
                    count += 1
                    k += 1
                else: 
                    flag2 = False
                if k == N:
                    flag2 = False
            j += 1
        else:
            flag1 = False
        if j == N:
            flag1 = False



print (count)

### FIXED CODE ###


from bisect import bisect_left, bisect_right
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

A.sort()
C.sort()


ans = 0
#Bの中の数iに対して、Aの中でiより小さい数の個数と、Cの中でiより大きい数の個数の積を探索
for i in B:
    ans += bisect_right(A, i-0.1) * (N-bisect_left(C, i+0.1))
print (ans)
### BUGGY CODE ###

import sys

s = sys.stdin.readline().strip()

MOD = 10 ** 9 + 7
mmap = []
for i in range(6):
    b = 10 ** i % 13
    mmap.append([[(b * i + j) % 13 for i in range(1,10)] for j in range(13)])

dp = [0] * 13
dp[0] = 1
j = 0
for c in reversed(s):
    tmp = dp.copy()

    if c == "0":
        pass
    elif c == "?":
        bset = mmap[j]
        for m, num in enumerate(tmp):
            if num == 0:
                continue
            for idx in bset[m]:
                dp[idx] += num
        
        for i in range(13):
            dp[i] %= MOD
    else:
        b = mmap[j][0][int(c) - 1]
        for n in range(13):
            idx = (n + b) % 13
            dp[idx] = tmp[n]
    
    if j==5:
        j = 0
    else:
        j+=1

print(dp[5])

### FIXED CODE ###

MOD = 10 ** 9 + 7
S = input()
l = len(S)

dp = [[0 for i in range(13)] for j in range(l + 5)]
dp[0][0] = 1

for i, s in enumerate(S):
    if s == '?':
        c = -1
    else:
        c = int(s)
    
    for j in range(10):
        if c != -1 and c != j:
            continue
        
        for n in range(13):
            dp[i + 1][(n * 10 + j) % 13] += dp[i][n]
        
        for m in range(13):
            dp[i + 1][m] %= MOD

print(dp[l][5])
### BUGGY CODE ###

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

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(N: int, K: int, A: "List[int]"):
    score = 1
    for i in range(K):
        score *= A[i]

    prev_score = score
    for i in range(N-K):
        score /= A[i]
        score *= A[i+K]
        if score>prev_score:
            print(YES)
        else:
            print(NO)
        prev_score = score
    return


# Generated by 1.1.7.1 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
    K = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, K, A)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(N: int, K: int, A: "List[int]"):
    for i in range(N-K):
        if A[i]<A[i+K]:
            print(YES)
        else:
            print(NO)
    return


# Generated by 1.1.7.1 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
    K = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, K, A)

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

n = int(input())
L=[]
for i in range(n):
	s= input()
	if s not in L:
		L.append(s)

print(len(L))

### FIXED CODE ###

n = int(input())
A=set()
B=set()

for i in range(n):
	s = input()
	if len(s)>=5:
		A.add(s)
	else:
		B.add(s)
		
print(len(A)+len(B))
### BUGGY CODE ###

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

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

while M > 0:
    num = lis.index(max(lis))
    lis[num] = int(lis[num] / 2)
    M -= 1

sum = 0

for i in range(len(lis)):
    sum += lis[i]
print(sum)

### FIXED CODE ###

N,M = map(int,input().split())
lis = list(map(lambda x: -int(x),input().split()))

import heapq
heapq.heapify(lis)
for _ in range(M):
    tmp = -heapq.heappop(lis)
    tmp //= 2
    heapq.heappush(lis,-tmp)

print(-sum(lis))
### BUGGY CODE ###

import math
import sys

def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()

    
    array_result.append(data.split(" "))

    flg = 1

    try:


        while flg:

            data = input()

            array_temp = []

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:


        return array_result

arr_data = getinputdata()

n = int(arr_data[0][0])

mysum = math.factorial(n)

cnt = 0

i = mysum

while i >= 1:
    
    if mysum % i == 0:
    
        cnt += 1
        
    i -= 1
    
n = 10 ** 9 + 7    
print(cnt % n)
    
    

### FIXED CODE ###

import math
from collections import Counter
def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()

    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()
            
            if(data != ""):
                
                array_result.append(data.split(" "))

            else:

                flg = 0
    finally:

        return array_result

arr_data = getinputdata()

n = int(arr_data[0][0])

mysum = math.factorial(n)

i = 2

if mysum==1:
    
    arr=[]

else:

    arr = []
    while i < mysum:

        if mysum % i == 0:

            arr.append(i)

            mysum = mysum // i

        else:

            i+=1

    else:

        arr.append(i)


list01=Counter(arr)

cnt=1
for k in list01:

    cnt *=list01[k]+1

print(cnt % (10 **9 +7))
### BUGGY CODE ###

from collections import deque

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

A.sort()

q=deque(A)
q2=deque()

cnt=0
while q:
	cnt+=1

	if cnt==1:
		v=q.popleft()
		q2.append(v)
	else:
		if cnt%2==0:
			v=q.pop()
		else:
			v=q.popleft()			

		begin=q2[0]
		end=q2[-1]

		if abs(begin-v)>=abs(end-v):
			q2.appendleft(v)
		else:
			q2.append(v)

l=list(q2)

ans=0
for i in range(N-1):
	ans+=abs(l[i+1]-l[i])

print ans


### FIXED CODE ###

import sys


N=input()
A=[  int(sys.stdin.readline()) for i in range(N) ] 

A.sort()

K=[]
K2=[]

if N%2==0:
	n=(N-2)/2
	K=[ -2 for i in range(n) ]+[-1,1]+[ 2 for i in range(n) ]
else:
	n=(N-2)/2

	## Pattern 1
	K=[ -2 for i in range(n) ]+[-1,-1]+[ 2 for i in range(n+1) ]
	## End

	## Pattern 2
	K2=[ -2 for i in range(n+1) ]+[1,1]+[ 2 for i in range(n) ]
	## End

ans=0

t1=0
for x, y in zip(A,K):
	t1+=x*y

t2=0
for x, y in zip(A,K2):
	t2+=x*y


print max(t1,t2)
### BUGGY CODE ###

n = int(input())
line2 = input().split()
h_list = [int(x) for x in line2]
 
max_count = 0
size = len(h_list)

for i in range(size):
    now = h_list[i]
    count = 0
    for j in range(i+1,size):
        if now >= h_list[j]:
            count += 1
            now = h_list[j]
        else:
            break
        
    if max_count < count:
        max_count = count

print(max_count)

### FIXED CODE ###

n = int(input())
line2 = input().split()
h_list = [int(x) for x in line2]
 
max_count = 0
size = len(h_list)

i = 0
while True: 
    if i == size-1:
        break
    now = h_list[i]
    count = 0
    for j in range(i+1,size):
        if now >= h_list[j]:
            count += 1
            now = h_list[j]
        else:
            break
    if max_count < count:
        max_count = count
        
    if max_count >= size - i:
        break
        
    i = j
    
print(max_count)
### BUGGY CODE ###

H, W, M = map(int, input().split())
hlist = [0] * H
wlist = [0] * W
hw = [[0 for _ in range(W)] for _ in range(H)]
for i in range(M):
    h, w = map(int, input().split())
    hlist[h - 1] += 1
    wlist[w - 1] += 1
    hw[h - 1][w - 1] = 1

hmax = max(hlist)
wmax = max(wlist)
hmaxlist = [i for i, v in enumerate(hlist) if v == hmax]
wmaxlist = [i for i, v in enumerate(wlist) if v == wmax]
cnt = -1
for i in hmaxlist:
    bf = False
    for j in wmaxlist:
        if hw[i][j] != 1:
            cnt = 0
            bf = True
            break
    if bf:
        break

print(hmax + wmax + cnt)

### FIXED CODE ###

H, W, M = map(int, input().split())
hlist = [0] * H
wlist = [0] * W
hw = set()
for i in range(M):
    h, w = map(int, input().split())
    hlist[h - 1] += 1
    wlist[w - 1] += 1
    hw.add((h - 1, w - 1))

hmax = max(hlist)
wmax = max(wlist)
hmaxlist = [i for i, v in enumerate(hlist) if v == hmax]
wmaxlist = [i for i, v in enumerate(wlist) if v == wmax]
cnt = -1
for i in hmaxlist:
    bf = False
    for j in wmaxlist:
        if not (i, j) in hw:
            cnt = 0
            bf = True
            break
    if bf:
        break

print(hmax + wmax + cnt)
### BUGGY CODE ###

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

mod = a % b / b
ans = int(a*n/b)-a*int(n/b)
for i in range(n)[::-1]:
    tmp = int(a * i / b) - a * int(i / b)
    ans = max(ans, tmp)


print(ans)


### FIXED CODE ###

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

tmp = min(b-1, n)
print(int(a*tmp/b)-a*int(tmp/b))
### BUGGY CODE ###

class Dice:
    def __init__(self, labels):
        self.labels = labels
    def east(self):
        self.labels[1], self.labels[2], self.labels[3], self.labels[4] = self.labels[3], self.labels[1], self.labels[4], self.labels[2]
    def west(self):
        self.labels[1], self.labels[2], self.labels[3], self.labels[4] = self.labels[2], self.labels[4], self.labels[1], self.labels[3]
    def north(self):
        self.labels[0], self.labels[1], self.labels[4], self.labels[5] = self.labels[1], self.labels[5], self.labels[0], self.labels[4]
    def south(self):
        self.labels[0], self.labels[1], self.labels[4], self.labels[5] = self.labels[4], self.labels[0], self.labels[5], self.labels[1]
    
    def clockwise(self):
        self.labels[1], self.labels[2], self.labels[4], self.labels[3] = self.labels[2], self.labels[4], self.labels[3], self.labels[1]

dice = Dice(list(map(int, input().split())))

for n in range(int(input())):
    top, foward = map(int, input().split())
    south_cnt = 0

    while True:
        if foward == dice.labels[1] and top == dice.labels[0]:
            break
        if foward == dice.labels[1]:
            dice.east()
        elif top == dice.labels[0]:
            dice.clockwise()
        else:
            if south_cnt == 3:
                dice.east()
            else:
                dice.south()
                south_cnt += 1
    print(dice.labels[2])




### FIXED CODE ###

class Dice:
    def __init__(self, labels):
        self.labels = labels
    def east(self):
        self.labels[0], self.labels[2], self.labels[5], self.labels[3] = self.labels[3], self.labels[0], self.labels[2], self.labels[5]
    def west(self):
        self.labels[0], self.labels[2], self.labels[5], self.labels[3] = self.labels[2], self.labels[5], self.labels[3], self.labels[0]
    def north(self):
        self.labels[0], self.labels[1], self.labels[5], self.labels[4] = self.labels[1], self.labels[5], self.labels[4], self.labels[0]
    def south(self):
        self.labels[0], self.labels[1], self.labels[5], self.labels[4] = self.labels[4], self.labels[0], self.labels[1], self.labels[5]

dice = Dice(list(map(int, input().split())))

for n in range(int(input())):
    top, foward = map(int, input().split())
    south_cnt = 0

    while True:
        #print(dice.labels[0], dice.labels[1], dice.labels[2], dice.labels[4], dice.labels[3])
        if foward == dice.labels[1] and top == dice.labels[0]:
            break
        if foward == dice.labels[1]:
            dice.east()
        elif top == dice.labels[0]:
            dice.south()
            dice.east()
            dice.north()
        else:
            if south_cnt == 3:
                dice.east()
            else:
                dice.south()
                south_cnt += 1
    print(dice.labels[2])
### BUGGY CODE ###

x = input()
i = 1
while (x != '0'):
 print("Case{}: {}".format(i, x))
 i += 1

### FIXED CODE ###

i = 1
while True:
    x = int(input().strip())
    if x == 0:
        break
    else:
        print ("Case {}: {}".format(i,x))
        i += 1
### BUGGY CODE ###

# coding: utf-8
# Your code here!
import math
line = list(map(int,input().split()))
A,B,N =line[0],line[1],line[2]

ans = (N+1)//B
if ans ==0:
    print(math.floor(A*N/B)-A*math.floor(N/B))
else:
    start = (math.floor(A*N/B)-A*math.floor(N/B))
    for i in range(1,ans+1):
        x= i*B-1
        start = max((math.floor(A*x/B)-A*(i-1)),start)
    print(start)

### FIXED CODE ###

# coding: utf-8
# Your code here!
def main():
    import sys
    line = sys.stdin.readline
    A,B,N = map(int,input().split())
    if B>N:
        ans = A*N//B
    else:
        ans = A*(B-1)//B
    print(ans)

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

N=int(input())
A=list(map(int,input().split()))
visited=[False for i in range(10**6+1)]
ban=[False for i in range(10**6+1)]
from collections import Counter
A.sort()
D=dict(Counter(A))
for n in A:
    if visited[n]==False:
        visited[n]=True
        for j in range(2,10**6):
            if 10**6<n*j:
                break 
            ban[n*j]=True
ans=0
for n in A:
    if D[n]==1 and ban[n]==False:
        ans+=1
print(ans)



### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
visited=[False for i in range(10**6+1)]
ban=[False for i in range(10**6+1)]
from collections import Counter
A.sort()
D=dict(Counter(A))
for n in A:
    if visited[n]==False:
        visited[n]=True
        for j in range(2,10**6):
            if 10**6<n*j:
                break 
            ban[n*j]=True
ans=0
for n in A:
    if D[n]==1 and ban[n]==False:
        ans+=1
print(ans)
### BUGGY CODE ###

n=int(input())
a=list(map(int, input().split()))
count=[0]*(n+1)
for i in range (n):
    count[a[i]]+=1
for i in range(n):
    count[a[i]]-=1
    c=0
    for j in range(1,n+1):
        c=c+count[j]*(count[j]-1)//2
    print(c)
    count[a[i]] +=1


### FIXED CODE ###

n=int(input())
a=list(map(int, input().split()))
count=[0]*(n+1)
for i in range (n):
    count[a[i]]+=1
m=0
for i in range (1,n+1):
    m+=count[i]*(count[i]-1)//2
for i in range (n):
   print(m-(count[a[i]]-1))