Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = []
for _ in range(n):
    tmp=sorted(input(), key=str.lower)
    s.append(tmp)
cnt = 0
for i in range(n-1):
    for j in range(i+1,n):
        if s[i]==s[j]:
            cnt+=1
print(cnt)


Fixed submission:
N = int(input())
S = [''.join(sorted(input().rstrip())) for _ in range(N)]
 
from collections import Counter
counter = Counter(S)
 
answer = sum(x*(x-1)//2 for x in counter.values())
print(answer)

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = []
for _ in range(n):
    tmp = input()
    tmp.sort()
    s.append(tmp)
cnt = 0
for i in range(n-1):
    for j in range(1,n):
        if s[i]==s[j]:
            cnt+=1
print(cnt)


Fixed submission:
N = int(input())
S = [''.join(sorted(input().rstrip())) for _ in range(N)]
 
from collections import Counter
counter = Counter(S)
 
answer = sum(x*(x-1)//2 for x in counter.values())
print(answer)

Buggy python submission (verdict: Runtime Error):
n=int(input())
s = [input() for i in range(n)]
c=0
for i in range(n):
   b[i]=sorted(s[i])
   a[i]=''.join(b[i])
for i in range(n-1):
    for j in range(i+1,n):
        if a[i]==a[j]:
            c+=1
print(c)

Fixed submission:
N = int(input())
S = [''.join(sorted(input().rstrip())) for _ in range(N)]
 
from collections import Counter
counter = Counter(S)
 
answer = sum(x*(x-1)//2 for x in counter.values())
print(answer)

Buggy python submission (verdict: Runtime Error):
n=int(input())
s = [input() for i in range(n)]
c=0
for i in range(n):
   b[i]=sorted(s[i])
   a[i]=''.join(b[i])
for i in range(n-1):
    for j in range(i+1,n):
        if a[i]==a[j]:
            c+=1
print(c)

Fixed submission:
N = int(input())
S = [''.join(sorted(input().rstrip())) for _ in range(N)]
 
from collections import Counter
counter = Counter(S)
 
answer = sum(x*(x-1)//2 for x in counter.values())
print(answer)

Buggy python submission (verdict: Runtime Error):
n=int(input())
s = [input() for i in range(n)]
c=0
a=["" for i in range(n)]
for i in range(n):
   b[i]=sorted(s[i])
   a[i]=''.join(b[i])
for i in range(n-1):
    for j in range(i+1,n):
        if a[i]==a[j]:
            c+=1
print(c)

Fixed submission:
N = int(input())
S = [''.join(sorted(input().rstrip())) for _ in range(N)]
 
from collections import Counter
counter = Counter(S)
 
answer = sum(x*(x-1)//2 for x in counter.values())
print(answer)

Buggy python submission (verdict: Runtime Error):
n=int(input())
s = [input() for i in range(n)]
c=0
a=["" for i in range(n)]
for i in range(n):
   b[i]=sorted(s[i])
   a[i]=''.join(b[i])
   print(a)
for i in range(n-1):
    for j in range(i+1,n):
        if a[i]==a[j]:
            c+=1
print(c)

Fixed submission:
N = int(input())
S = [''.join(sorted(input().rstrip())) for _ in range(N)]
 
from collections import Counter
counter = Counter(S)
 
answer = sum(x*(x-1)//2 for x in counter.values())
print(answer)

Buggy python submission (verdict: Runtime Error):
n=int(input())
s = [input() for i in range(n)]
c=0
a=["" for i in range(n)]
for i in range(n):
   b[i]=sorted(s[i])
   a[i]=''.join(b[i])

for i in range(n-1):
    for j in range(i+1,n):
        if a[i]==a[j]:
            c+=1
print(c)

Fixed submission:
N = int(input())
S = [''.join(sorted(input().rstrip())) for _ in range(N)]
 
from collections import Counter
counter = Counter(S)
 
answer = sum(x*(x-1)//2 for x in counter.values())
print(answer)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s = [input() for i in range(n)]
c=0
a=["" for i in range(n)]
for i in range(n):
   b=(sorted([s[i][j] for j in range(10)]))
   a[i]=''.join(b)

for i in range(n-1):
    for j in range(i+1,n):
        if a[i]==a[j]:
            c+=1
print(c)

Fixed submission:
N = int(input())
S = [''.join(sorted(input().rstrip())) for _ in range(N)]
 
from collections import Counter
counter = Counter(S)
 
answer = sum(x*(x-1)//2 for x in counter.values())
print(answer)

Buggy python submission (verdict: Runtime Error):
n=int(input())
s = [input() for i in range(n)]
c=0
print(s)
for i in range(n):
   r[i]=(sorted([s[i][j] for j in range(10)]))
   r[i]=''.join(r[i])
for i in range(n-1):
    for j in range(i+1,n):
        if r[i]==r[j]:
            c+=1
print(c)

Fixed submission:
N = int(input())
S = [''.join(sorted(input().rstrip())) for _ in range(N)]
 
from collections import Counter
counter = Counter(S)
 
answer = sum(x*(x-1)//2 for x in counter.values())
print(answer)

Buggy python submission (verdict: Runtime Error):
n=int(input())
s = [input() for i in range(n)]
c=0
for i in range(n):
   r[i]=(((sorted([s[i][j] for j in range(10)]))))
   r[i]=''.join(r[i])
for i in range(n-1):
    for j in range(i+1,n):
        if r[i]==r[j]:
            c+=1
print(c)

Fixed submission:
N = int(input())
S = [''.join(sorted(input().rstrip())) for _ in range(N)]
 
from collections import Counter
counter = Counter(S)
 
answer = sum(x*(x-1)//2 for x in counter.values())
print(answer)