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

n,m=map(int,input().split())
h=list(map(int,input().split()))
miti=[[0]*n for i in range(n)]
for i in range(m):
    a,b=map(int,input().split())
    miti[a-1][b-1]=1
    miti[b-1][a-1]=1



def check(i):
    hi=h[i]
    for j in range(n):
        if miti[i][j]==1:
            if hi<=h[j]:
                return False
    return True





count=0
for i in range(n):
    if check(i):
        count+=1

print(count)


### FIXED CODE ###

n,m=map(int,input().split())
h=list(map(int,input().split()))
miti=[[0] for i in range(n)]
for i in range(m):
    a,b=map(int,input().split())
    a-=1
    b-=1
    miti[a].append(h[b])
    miti[b].append(h[a])


count=0
for i in range(n):
    if h[i] > max(miti[i]):
        count+=1
print(count)
### BUGGY CODE ###

import math
import queue

def readInt():
	return int(input())

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

def readChars():
	return input().split()

s = input()

ai = [0]*len(s)
si = [0]*len(s)

p = 2019

for i in range(len(s)):
	ai[i] = (int(s[-1*i-1])*pow(10,i))%p
for i in range(len(ai)):
	si[i] = sum(ai[:i+1])%p
	#print(ai[:i+1],1)


res = si.count(0)
for i in range(p):
	c = si.count(i)
	res += c*(c-1)//2

print(res)

### FIXED CODE ###

import math

def readInt():
	return int(input())

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

def readChars():
	return input().split()

s = reversed(input())

ai = 0
si = 0

p = 2019
countarr = [0]*2019

for i, j in enumerate(s):
	ai = (int(j)*pow(10,i,p))%p
	si = (si+ai)%p
	countarr[si]+=1

res = countarr[0]
for i in range(p):
	c = countarr[i]
	res += c*(c-1)//2

print(res)
### BUGGY CODE ###

import itertools
n,m,r = map(int, input().split())
req = list(map(lambda x:int(x)-1, input().split()))
dist = [[float('inf') for j in range(n)] for i in range(n)]
for i in range(m):
    a,b,c = map(int, input().split())
    a -= 1
    b -= 1
    dist[a][b] = c
    dist[b][a] = c

for k in range(n):
    for i in range(n):
        for j in range(n):
            dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j])

min_dist = float('inf')
for p in itertools.permutations(req):
    total_dist = 0
    for i in range(r-1):
        total_dist += dist[p[i]][p[i+1]]
    min_dist = min(min_dist, total_dist)
print(min_dist)
                

### FIXED CODE ###

import itertools
n,m,r = map(int, input().split())
req = list(map(lambda x:int(x)-1, input().split()))
dist = [[float('inf') for j in range(n)] for i in range(n)]
for i in range(m):
    a,b,c = map(int, input().split())
    a -= 1
    b -= 1
    dist[a][b] = c
    dist[b][a] = c

for k in range(n):
    for i in range(n):
        for j in range(n):
            dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j])

min_dist = float('inf')
for p in itertools.permutations(req):
    total_dist = 0
    for i in range(r-1):
        total_dist += dist[p[i]][p[i+1]]
    min_dist = min(min_dist, total_dist)
print(min_dist)
### BUGGY CODE ###

import sys
MOD=10**9+7

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

abi=[0]*64
aze=[0]*64

for item in a:
    j=0
    #print(bin(item))
    while j<len(str(bin(item)))-2:
        #print(j)
        if item>>j & 1:
            abi[j]+=1
        else:
            aze[j]+=1
        j+=1
    k=len(str(bin(item)))-2
    while k<64:
        aze[k]+=1
        k+=1


        #print(abi)

result=0
i=0
while i<64:
    result+=(2**i)*abi[i]*(aze[i])%MOD

    i+=1

#print(abi[:4])

#print(aze[:4])
print(result%MOD)


"""
01
10
11
"""



"""
0001
0010
0011
0100
0101
0110
0111
"""

### FIXED CODE ###

import sys
MOD=10**9+7

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

abi=[0]*61
aze=[0]*61

for item in a:
    j=0
    #print(bin(item))
    while j<61:
        #print(j)
        if item>>j & 1:
            abi[j]+=1
        else:
            aze[j]+=1
        j+=1

        #print(abi)

result=0
i=0
while i<61:
    result+=(2**i)%MOD*abi[i]%MOD*(aze[i])%MOD

    i+=1

#print(abi[:4])

#print(aze[:4])
print(result%MOD)


"""
01
10
11
"""



"""
0001
0010
0011
0100
0101
0110
0111
"""
### BUGGY CODE ###

# -*- coding: utf-8 -*-
import numpy as np

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

Xi = np.zeros((N+1,N+1),dtype=np.int32)
for i in range(M):
    L, R = map(int, input().split())
    Xi[L][R] += 1

Ci = np.zeros((N+1,N+1),dtype=np.int32)
tmp = 0
for l in range(N+1):
    for r in range(N+1):
        tmp += Xi[l][r]
        Ci[l][r] = tmp

# print(Ci)

for r in range(N+1):
    tmp = 0
    for l in range(N+1):
        tmp += Ci[l][r]
        Ci[l][r] = tmp

# print(Ci)

# pqi = []
ans = []
for i in range(Q):
    p, q = map(int, input().split())
    # pqi.append((p,q))
    tmp = Ci[q][q] - Ci[q][p-1]  - Ci[p-1][q] + Ci[p-1][p-1]
    ans.append(tmp)

# print(Ci)

for a in ans:
    print(a)
#
# for (p, q) in pqi:
#     tmp = 0
#     for l in range(p,q+1):
#         tmp += Ci[l][q] - Ci[l][p-1]
#
#     print(tmp)


### FIXED CODE ###

# -*- coding: utf-8 -*-
# import numpy as np

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

# Xi = np.zeros((N+1,N+1),dtype=np.int32)
Xi = [[0]*(N+1) for i in range(N+1)]
for i in range(M):
    L, R = map(int, input().split())
    Xi[L][R] += 1

# Ci = np.zeros((N+1,N+1),dtype=np.int32)
Ci = [[0]*(N+1) for i in range(N+1)]
tmp = 0
for l in range(N+1):
    for r in range(N+1):
        tmp += Xi[l][r]
        Ci[l][r] = tmp

# print(Ci)

for r in range(N+1):
    tmp = 0
    for l in range(N+1):
        tmp += Ci[l][r]
        Ci[l][r] = tmp

# print(Ci)

pqi = []
for i in range(Q):
    p, q = map(int, input().split())
    pqi.append((p,q))

for (p, q) in pqi:
    tmp = Ci[q][q] - Ci[q][p-1]  - Ci[p-1][q] + Ci[p-1][p-1]
    print(tmp)
### BUGGY CODE ###

from collections import defaultdict
import sys
from scipy.sparse.csgraph import connected_components
from scipy.sparse import csr_matrix



def read():
    return sys.stdin.readline().rstrip()


def main():
    n, m, k = map(int, read().split())
    friend, block = defaultdict(set), defaultdict(set)
    csr = csr_matrix((n, n), dtype=int)
    for _ in range(m):
        a, b = [int(i) - 1 for i in read().split()]
        friend[a].add(b)
        friend[b].add(a)
        csr[a, b] = 1
    for _ in range(k):
        c, d = [int(i) - 1 for i in read().split()]
        block[c].add(d)
        block[d].add(c)
    _, belonging = connected_components(csr_matrix(csr))
    group = defaultdict(set)
    for i, b in enumerate(belonging):
        group[b].add(i)
    suggestion = [len(group[belonging[i]].difference(friend[i]).difference(block[i])) - 1 for i in range(n)]
    print(*suggestion)


if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
from collections import deque

def read():
    return sys.stdin.readline().rstrip()

def main():
    n, m, k = map(int, read().split())
    friend = [[] for _ in range(n)]
    block = [set() for _ in range(n)]
    potential = [set() for _ in range(n)]
    for _ in range(m):
        a, b = [int(i) - 1 for i in read().split()]
        friend[a].append(b)
        friend[b].append(a)
    for _ in range(k):
        c, d = [int(i) - 1 for i in read().split()]
        block[c].add(d)
        block[d].add(c)
    sd = set()
    for u in range(n):
        if u in sd:
            continue
        sn = deque([u])
        pf = set()
        while sn:
            p = sn.pop()
            if p in sd:
                continue
            sd.add(p)
            pf.add(p)
            for f in friend[p]:
                sn.append(f)
        for pfi in pf:
            potential[pfi] = pf
    print(*[len(potential[i]) - len(block[i] & potential[i]) - len(friend[i]) - 1 for i in range(n)])

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

n, k, q = map(int, input().split())
correct = []
for j in range(q):
    correct.append(int(input()))
score = [k]*n
for h in range(q):
    score = list(map(lambda x: x-1, score))
    score[correct[h]-1] += 1
for i in range(n):
    if score[i] > 0:
        print("Yes")
    else:
        print("No")

### FIXED CODE ###

n, k, q = map(int, input().split())
correct = []
for j in range(q):
    correct.append(int(input()))
score = [k-q]*n
for h in range(q):
    score[correct[h]-1] += 1
for i in range(n):
    if score[i] > 0:
        print("Yes")
    else:
        print("No")
### BUGGY CODE ###

from collections import Counter


class Node:

    def __init__(self, i):
        self.index = i
        self.parent = self

    def root(self):
        if self.parent == self:
            return self.parent
        else:
            self.parent = self.parent.root()
            return self.parent

    def unite(self, other):
        self.root().parent = other.root()

    def is_unite(self, other):
        return self.root() == other.root()


def solve(N, K, L, PQs, RSs):
    road_cities = [Node(i) for i in range(N + 1)]
    train_cities = [Node(i) for i in range(N + 1)]

    for p, q in PQs:
        road_cities[p].unite(road_cities[q])
    for r, s in RSs:
        train_cities[r].unite(train_cities[s])

    counts = Counter([
        (road_cities[i].root().index, train_cities[i].root().index)
        for i in range(1, N + 1)
    ])

    ans = [
        counts[(road_cities[i].root().index, train_cities[i].root().index)]
        for i in range(1, N + 1)
    ]

    return " ".join([str(c) for c in ans])


if __name__ == "__main__":
    N, K, L = map(int, input().split(" "))
    PQs = []
    RSs = []
    for _ in range(K):
        PQs.append(tuple(map(int, input().split(" "))))
    for _ in range(L):
        RSs.append(tuple(map(int, input().split(" "))))
    print(solve(N, K, L, PQs, RSs))


### FIXED CODE ###

from collections import Counter


class UnionFind:
    def __init__(self, n):
        self.parents = [i for i in range(n + 1)]

    def root(self, i):
        if self.parents[i] == i:
            return i
        else:
            self.parents[i] = self.root(self.parents[i])
            return self.parents[i]

    def unite(self, i, j):
        self.parents[self.root(self.parents[i])] = self.root(j)

    def is_unite(self, i, j):
        return self.root(i) == self.root(j)


def solve(N, K, L, PQs, RSs):
    road_cities = UnionFind(N)
    train_cities = UnionFind(N)

    for p, q in PQs:
        road_cities.unite(p, q)
    for r, s in RSs:
        train_cities.unite(r, s)

    counts = Counter([
        (road_cities.root(i), train_cities.root(i))
        for i in range(1, N + 1)
    ])

    ans = [
        counts[(road_cities.root(i), train_cities.root(i))]
        for i in range(1, N + 1)
    ]

    return " ".join([str(c) for c in ans])


if __name__ == "__main__":
    N, K, L = map(int, input().split(" "))
    PQs = []
    RSs = []
    for _ in range(K):
        PQs.append(tuple(map(int, input().split(" "))))
    for _ in range(L):
        RSs.append(tuple(map(int, input().split(" "))))
    print(solve(N, K, L, PQs, RSs))
### BUGGY CODE ###

from collections import deque
import sys


H, W = [int(_) for _ in input().split()]

M = []
queues = []
for i in range(H):
    A = input()
    M.append(list(A))
    for j in range(W):
        if A[j] == '#':
            queues.append(deque([[j, i, 0]]))

depth_now = 0
depth = 0
while True:
    for q in queues:
        while len(q) != 0 and q[0][2] == depth_now:
            p = q.popleft()
            x = p[0]
            y = p[1]
            depth = p[2]
            cands = []
            if x - 1 >= 0:
                cands.append([x-1, y])
            if x + 1 < W:
                cands.append([x+1, y])
            if y - 1 >= 0:
                cands.append([x, y-1])
            if y + 1 < H:
                cands.append([x, y+1])
            for cx, cy in cands:
                if M[cy][cx] == '.':
                    q.append([cx, cy, depth+1])
                    M[cy][cx] = '#'
    queues = [q for q in queues if len(q) != 0]
    if len(queues) == 0:
        print(depth_now)
        break
    depth_now += 1


### FIXED CODE ###

from collections import deque
import sys


H, W = [int(_) for _ in input().split()]

M = []
q = deque([])
for i in range(H):
    A = input()
    M.append(list(A))
    for j in range(W):
        if A[j] == '#':
            q.append([j, i, 0])

depth_now = 0
depth = 0
count = 0
while len(q) > 0:
    p = q.popleft()
    x = p[0]
    y = p[1]
    depth = p[2]
    if x - 1 >= 0 and M[y][x-1] == '.':
        q.append([x-1, y, depth+1])
        M[y][x-1] = '#'
    if x + 1 < W and M[y][x+1] == '.':
        q.append([x+1, y, depth+1])
        M[y][x+1] = '#'
    if y - 1 >= 0 and M[y-1][x] == '.':
        q.append([x, y-1, depth+1])
        M[y-1][x] = '#'
    if y + 1 < H and M[y+1][x] == '.':
        q.append([x, y+1, depth+1])
        M[y+1][x] = '#'
print(depth)
### BUGGY CODE ###

import math

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

def get_primenumber(number):#エラトステネスの篩
    prime_list = []
    search_list = list(range(2,number+1))
    #search_listの先頭の値が√nの値を超えたら終了
    while search_list[0] <= math.sqrt(number):
        #search_listの先頭の値が√nの値を超えたら終了
        #search_listの先頭をprime_listに入れて、先頭をリストに追加して削除
        head_num = search_list.pop(0)
        prime_list.append(head_num)
        #head_numの倍数を除去
        for i in range(number // head_num):
            if D[head_num * (i + 1)] == -1:
                D[head_num * (i + 1)] = head_num
        search_list = [num for num in search_list if num % head_num != 0]
    #prime_listにsearch_listを結合
    prime_list.extend(search_list)
    return prime_list


def factrization_prime(number):
    div = D[number]
    s = math.sqrt(number)
    while div <= s:
        div_cnt = 0
        while number % div == 0:
            div_cnt += 1
            number //= div
        ans_array[div] += 1
        if number == 1:
            break
        div = D[number]
    if number > 1:
        ans_array[number] += 1

thre = pow(10, 6) + 1
ans_array = [0] * thre
D = [-1] * (thre + 1)

prime_list = get_primenumber(thre)
for a in a_array:
    factrization_prime(a)

max_ans_array = max(ans_array)
if max_ans_array == 1:
    print('pairwise coprime')
elif max_ans_array < n:
    print('setwise coprime')
else:
    print('not coprime')

### FIXED CODE ###

import math

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

def get_primenumber(number):#エラトステネスの篩
    prime_list = []
    search_list = list(range(2,number+1))
    #search_listの先頭の値が√nの値を超えたら終了
    while search_list[0] <= math.sqrt(number):
        #search_listの先頭の値が√nの値を超えたら終了
        #search_listの先頭をprime_listに入れて、先頭をリストに追加して削除
        head_num = search_list.pop(0)
        prime_list.append(head_num)
        #head_numの倍数を除去
        for i in range(number // head_num):
            index = head_num * (i + 1)
            if D[index] == index:
                D[index] = head_num
        search_list = [num for num in search_list if num % head_num != 0]
    #prime_listにsearch_listを結合
    prime_list.extend(search_list)
    return prime_list


def factrization_prime(number):
    div = D[number]
    s = math.sqrt(number)
    div_set = set()
    while number > 1:
        number //= div
        div_set.add(div)
        div = D[number]
    if number > 1:
        div_set.add(div)
    for div in div_set:
        ans_array[div] += 1


# thre = pow(10, 6) + 1
thre = max(a_array) + 1
ans_array = [0] * thre
D = list(range(thre + 1))

prime_list = get_primenumber(thre)
# print(D[-10:])
for a in a_array:
    factrization_prime(a)
# print(ans_array)

max_ans_array = max(ans_array)
if max_ans_array <= 1:
    print('pairwise coprime')
elif max_ans_array < n:
    print('setwise coprime')
else:
    print('not coprime')
### BUGGY CODE ###

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

max = 0
rest = n
for i in range(n-1):
    counter = 0
    for j in range(n-i-1):
        if List[i+j] >= List[i+j+1]:
            counter +=1
            if counter > max:
                max = counter
            
            if rest < max:
                break
        else:
            break
        
print(max)

### FIXED CODE ###

N = int(input())
H = list(map(int,input().split()))
counter = 0
Ans = 0
temp = 0
for i in range(N-1):
  if H[counter]>=H[counter+1]:
    temp += 1
    if temp > Ans:
      Ans = temp
    counter += 1
  else:
    temp = 0
    counter += 1
    
print(Ans)
### BUGGY CODE ###

# C - Marks
from functools import reduce
from operator import mul


def main():
    N, K, *A = map(int, open(0).read().split())
    top_idx, prev_score = 0, reduce(mul, A[:K])
    res = []
    for top, cur in zip(A, A[K:]):
        cur_score = prev_score // top * cur
        res.append("Yes" if cur_score > prev_score else "No")
        prev_score = cur_score
    print("\n".join(res))


if __name__ == "__main__":
    main()


### FIXED CODE ###

# C - Marks
def main():
    N, K, *A = map(int, open(0).read().split())
    res = ["Yes" if tail > top else "No" for top, tail in zip(A, A[K:])]
    print("\n".join(res))


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

R,G,B,n=map(int, input().split())
cnt=0
for r in range(n+1):
    for g in range(n+1):
        b=(n-r*R-g*G)/B
        #print(r,g,b)
        if b>=0:
            if b==int(b):
                cnt+=1

print(cnt)

### FIXED CODE ###

R,G,B,n=map(int, input().split())
cnt=0
for r in range(n+1):
    for g in range(n+1):
        b=(n-r*R-g*G)/B
        #print(r,g,b)
        if b>=0:
            if b==int(b):
                cnt+=1

print(cnt)
### BUGGY CODE ###

N = int(input())
S = input()
ans = N
for i in range(N):
    C = S[:i].count('W') + S[i + 1:N].count('E')
    if C < ans:
        ans = C
print(ans)


### FIXED CODE ###

N = int(input())
S = input()
W = [0] * N
E = [0] * N
for i in range(N):
    if i == 0:
        if S[i] == 'W':
            W[i] = 1
        continue
    if S[i] == 'W':
        W[i] = W[i - 1] + 1
    else:
        W[i] = W[i - 1]
for i in range(N - 1, -1, -1):
    if i == N - 1:
        if S[i] == 'E':
            E[i] = 1
        continue
    if S[i] == 'E':
        E[i] = E[i + 1] + 1
    else:
        E[i] = E[i + 1]
A = []
for i in range(N):
    A.append(W[i] + E[i] - 1)
print(min(A))
### BUGGY CODE ###

import sys
input = sys.stdin.readline
N = int(input())
abc = [[int(j) for j in input().split()] for _ in range(N-1)]
Q,K = map(int, input().split())
xy = [ [int(j) for j in input().split()] for _ in range(Q)]

inf = float("inf")
con = [ [] for _ in range(N+1)]
cost = [ [inf] * (N+1) for _ in range(N+1)]

for i in range(N-1):
    a,b,c = abc[i]
    con[a].append(b)
    con[b].append(a)
    cost[a][b] = c
    cost[b][a] = c

def dfs(a,b, par):
    if cost[a][b] != inf:
        return cost[a][b]
    if len(list(filter(lambda x: x!=par, con[a]))) == 0:
        return inf

    cst = inf
    idx= -1
    for e,ch in enumerate(con[a]):
        if ch == par:
            continue
        if cst > cost[a][ch] + dfs(ch,b,a):
            cst = cost[a][ch] + dfs(ch,b,a)
            idx = e
        # cst = min(cst, cost[a][ch] + dfs(ch, b, a))
    if idx != -1:
        cost[a][b] = cst
    return cst

for i in range(Q):
    x,y = xy[i]
    print(dfs(x,K,None) + dfs(K,y,None))
    


### FIXED CODE ###

import sys
input = sys.stdin.readline
N = int(input())
abc = [[int(j) for j in input().split()] for _ in range(N-1)]
Q,K = map(int, input().split())
xy = [ [int(j) for j in input().split()] for _ in range(Q)]

inf = float("inf")
con = [ [] for _ in range(N+1)]
# cost = [ [inf] * (N+1) for _ in range(N+1)]
# cost = {}
from collections import defaultdict
# cost =  defaultdict(  )

for i in range(N-1):
    a,b,c = abc[i]
    con[a].append((b, c))
    con[b].append((a, c))

q = [(K,0)]
visited = [False] * (N+1)
visited[K] = True
costmap = [inf] * (N+1)
costmap[K] = 0
while q:
    n,cst = q.pop()
    for ch,chcst in con[n]:
        if visited[ch]:
            continue
        q.append( (ch, cst+chcst))
        visited[ch] = True
        costmap[ch]  = cst+ chcst
    
# def dfs(a,b, par):
#     if cost[a][b] != inf :
#         return cost[a][b]
# 
#     if len(list(filter(lambda x: x!=par, con[a]))) == 0:
#         return inf
# 
#     cst = inf
#     idx= -1
#     for e,ch in enumerate(con[a]):
#         if ch == par:
#             continue
#         if cst > cost[a][ch] + dfs(ch,b,a):
#             cst = cost[a][ch] + dfs(ch,b,a)
#             
#             idx = e
#     if idx != -1:
#         cost[a][b] = cst
#         cost[b][a] = cst
#     return cst
# 
for i in range(Q):
    x,y = xy[i]
    print( costmap[x] + costmap[y])
# for i in range(Q):
#     x,y = xy[i]
#     # _ = dfs(K,x,None)
#     # _ = dfs(y,K, None)
#     print(dfs(x,K,None) + dfs(K,y,None))
### BUGGY CODE ###

N = int(input())
List = [int(i) for i in input().split(" ")]
flag = 0
for j in range(N-1):
    for k in range(j+1,N):
        if List[j]==List[k]:
            flag = 1
            break
        if flag==1:
            break
if flag==1:
    print("NO")
else:
    print("YES")

### FIXED CODE ###

N = int(input())
List = [i for i in input().split(" ")]
Dict = {}
flag=0
for i in range(N):
    try:
        Dict[List[i]] += 1
    except KeyError:
        Dict[List[i]] = 1
        
list2 = list(Dict.values())
for j in range(len(list2)):
    if list2[j]>1:
        flag=1
if flag==1:
    print("NO")
else:
    print("YES")
### BUGGY CODE ###

import sys
import math
from fractions import gcd
# import queue
# from collections import Counter
# from itertools import accumulate
# from functools import reduce

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

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

def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

big_prime = 1000000007

"""
# 標準入力取得
## 文字列
 =  sys.stdin.readline().rstrip()
 =  list(sys.stdin.readline().rstrip())

## 数値
 =  int(sys.stdin.readline())
 =  map(int, sys.stdin.readline().split())
 =  list(map(int, sys.stdin.readline().split()))
 =  [list(map(int,list(sys.stdin.readline().split()))) for i in range(N)]
"""
n,k,q =  map(int, sys.stdin.readline().split())
l=[0]*n
def penalty(b):
    return b + 1

for i in range(q):
    a =  int(sys.stdin.readline())
    l=list(map(penalty, l))
    l[a-1]-=1

for e in l:
    if e >=k:
        print("No")
    else:
        print("Yes")

### FIXED CODE ###

import sys
import math
from fractions import gcd
# import queue
# from collections import Counter
# from itertools import accumulate
# from functools import reduce

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

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

def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

big_prime = 1000000007

"""
# 標準入力取得
## 文字列
 =  sys.stdin.readline().rstrip()
 =  list(sys.stdin.readline().rstrip())

## 数値
 =  int(sys.stdin.readline())
 =  map(int, sys.stdin.readline().split())
 =  list(map(int, sys.stdin.readline().split()))
 =  [list(map(int,list(sys.stdin.readline().split()))) for i in range(N)]
"""
import numpy as np
n,k,q =  map(int, sys.stdin.readline().split())
l=[0]*n
l = np.array(l)
l+=q

# a=[l[i-1]-1 for i in  list(map(int,sys.stdin.readlines()))]
# print(a)
for i in range(q):
    a =  int(sys.stdin.readline())
    l[a-1]-=1

for e in l:
    if e >=k:
        print("No")
    else:
        print("Yes")
### BUGGY CODE ###

n,k=map(int,input().split())
a=list(map(int,input().split()))
tmp=1
for i in range(k):
    tmp*=a[i]

for i in range(n-k):
    prev=tmp
    tmp=int(tmp/a[i]*a[i+k])
    #print(tmp)
    if tmp>prev:
        print("Yes")
    else:
        print("No")
    

### FIXED CODE ###

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



for i in range(n-k):

    if a[i]<a[i+k]:
        print("Yes")
    else:
        print("No")
### BUGGY CODE ###

n = int(input())
s = []
for _ in range(n):
    #s.append(list(input())) # !!!
    s.append(sorted(list(input()))) # !!!
#print(s)

x = 0
for i in range(n):
    for j in range(i+1, n):
        if s[i] == s[j]:
            x += 1

print(x)
    



### FIXED CODE ###

n = int(input())
s = []
for _ in range(n):
    #s.append(list(input())) # !!!
    #s.append(sorted(list(input()))) # !!!
    #s.append(sorted(input())) # !!!
    s += [''.join(sorted(input()))]
    #''.join(sorted((sorted(input()))
s = sorted(s)
s.append('X')
#print(s)

a = []
x = 1
for i in range(1,n+1):
    if s[i] == s[i-1]:
        x += 1
    else:
        a.append(x)
        x = 1
#print(a)
y = 0

for j in a:
    y += j*(j-1)/2

print(int(y))