Buggy python submission (verdict: Runtime Error):
from math import factorial
N=int(input())
count=[0]
u=0
s=[sorted(input()) for i in range(N)]
s=sorted(s)
for t in range(N-1):
    if s[t+1]==s[t]:
        count[u]+=1
    else:
        count.append()
for i in range(u):
    a=factorial(u)/factorial(2)/factorial(u-2)
print(a)

Fixed submission:
N=int(input())
S=[''.join(sorted((input()))) for i in range(N)]
P={}
for i in range(N):
    if S[i] in P:
        P[S[i]]+=1
    else:
        P[S[i]]=0
for i in P.keys():
    if P[i]>=2:
        P[i]=P[i]*(P[i]+1)/2
print(int(sum(P.values())))

Buggy python submission (verdict: Runtime Error):
from math import factorial
N=int(input())
count=[0]
u=0
s=[sorted(input()) for i in range(N)]
s=sorted(s)
for t in range(N-1):
    if s[t+1]==s[t]:
        count[u]+=1
    else:
        u.append(0)
for i in range(u):
    a=factorial(u)/factorial(2)/factorial(u-2)
print(a)

Fixed submission:
N=int(input())
S=[''.join(sorted((input()))) for i in range(N)]
P={}
for i in range(N):
    if S[i] in P:
        P[S[i]]+=1
    else:
        P[S[i]]=0
for i in P.keys():
    if P[i]>=2:
        P[i]=P[i]*(P[i]+1)/2
print(int(sum(P.values())))

Buggy python submission (verdict: Runtime Error):
from math import factorial
N=int(input())
count=[0]
u=0
s=[sorted(input()) for i in range(N)]
s=sorted(s)
for t in range(N-1):
    if s[t+1]==s[t]:
        count[u]+=1
    else:
        u.append(0)
for i in range(u):
    a=factorial(u)/factorial(2)/factorial(u-2)
print(a)

Fixed submission:
N=int(input())
S=[''.join(sorted((input()))) for i in range(N)]
P={}
for i in range(N):
    if S[i] in P:
        P[S[i]]+=1
    else:
        P[S[i]]=0
for i in P.keys():
    if P[i]>=2:
        P[i]=P[i]*(P[i]+1)/2
print(int(sum(P.values())))

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
count=0
s=[sorted(input()) for i in range(N)]
s=sorted(s)
for t in range(N):
    for i in range(t+1,N):
        if s[i]==s[t]:
            count+=1
print(count)

Fixed submission:
N=int(input())
S=[''.join(sorted((input()))) for i in range(N)]
P={}
for i in range(N):
    if S[i] in P:
        P[S[i]]+=1
    else:
        P[S[i]]=0
for i in P.keys():
    if P[i]>=2:
        P[i]=P[i]*(P[i]+1)/2
print(int(sum(P.values())))

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
count=0
s=[sorted(input()) for i in range(N)]
s=sorted(s)
for t in range(N):
    for i in range(t+1,N):
        if s[i]==s[t]:
            count+=1
print(count)

Fixed submission:
N=int(input())
S=[''.join(sorted((input()))) for i in range(N)]
P={}
for i in range(N):
    if S[i] in P:
        P[S[i]]+=1
    else:
        P[S[i]]=0
for i in P.keys():
    if P[i]>=2:
        P[i]=P[i]*(P[i]+1)/2
print(int(sum(P.values())))

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
count=0
s=[sorted(input()) for i in range(N)]
n=['a' for t in range(N) for i in range(t+1,N) if s[t]==s[i]]
print(len(n))

Fixed submission:
N=int(input())
S=[''.join(sorted((input()))) for i in range(N)]
P={}
for i in range(N):
    if S[i] in P:
        P[S[i]]+=1
    else:
        P[S[i]]=0
for i in P.keys():
    if P[i]>=2:
        P[i]=P[i]*(P[i]+1)/2
print(int(sum(P.values())))

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
count=0
s=[sorted(input()) for i in range(N)]
n=['a' for t in range(N) for i in range(t+1,N) if s[t]==s[i]]
print(len(n))

Fixed submission:
N=int(input())
S=[''.join(sorted((input()))) for i in range(N)]
P={}
for i in range(N):
    if S[i] in P:
        P[S[i]]+=1
    else:
        P[S[i]]=0
for i in P.keys():
    if P[i]>=2:
        P[i]=P[i]*(P[i]+1)/2
print(int(sum(P.values())))

Buggy python submission (verdict: Runtime Error):
N=int(input())
count=0
s=[input() for i in range(N)]
n=['a' for t in range(N) for i in range(t+1,N) if s[t].sort==s[i].sort]
print(len(n))

Fixed submission:
N=int(input())
S=[''.join(sorted((input()))) for i in range(N)]
P={}
for i in range(N):
    if S[i] in P:
        P[S[i]]+=1
    else:
        P[S[i]]=0
for i in P.keys():
    if P[i]>=2:
        P[i]=P[i]*(P[i]+1)/2
print(int(sum(P.values())))

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
count=0
s=[input() for i in range(N)]
n=['a' for t in range(N) for i in range(t+1,N) if sorted(s[t])==sorted(s[i])]
print(len(n))

Fixed submission:
N=int(input())
S=[''.join(sorted((input()))) for i in range(N)]
P={}
for i in range(N):
    if S[i] in P:
        P[S[i]]+=1
    else:
        P[S[i]]=0
for i in P.keys():
    if P[i]>=2:
        P[i]=P[i]*(P[i]+1)/2
print(int(sum(P.values())))

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
count=0
s=[input() for i in range(N)]
n=['a' for t in range(N) for i in range(t+1,N) if sorted(s[t])==sorted(s[i])]
print(len(n))

Fixed submission:
N=int(input())
S=[''.join(sorted((input()))) for i in range(N)]
P={}
for i in range(N):
    if S[i] in P:
        P[S[i]]+=1
    else:
        P[S[i]]=0
for i in P.keys():
    if P[i]>=2:
        P[i]=P[i]*(P[i]+1)/2
print(int(sum(P.values())))

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
N=int(input())
count=0
s=[input() for i in range(N)]
n=['a' for t in range(N) for i in range(t+1,N) if Counter(s[t])==Counter(s[i])]
print(len(n))

Fixed submission:
N=int(input())
S=[''.join(sorted((input()))) for i in range(N)]
P={}
for i in range(N):
    if S[i] in P:
        P[S[i]]+=1
    else:
        P[S[i]]=0
for i in P.keys():
    if P[i]>=2:
        P[i]=P[i]*(P[i]+1)/2
print(int(sum(P.values())))

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
N=int(input())
count=0
s=[input() for i in range(N)]
n=['a' for t in range(N) for i in range(t+1,N) if Counter(s[t])==Counter(s[i])]
print(len(n))

Fixed submission:
N=int(input())
S=[''.join(sorted((input()))) for i in range(N)]
P={}
for i in range(N):
    if S[i] in P:
        P[S[i]]+=1
    else:
        P[S[i]]=0
for i in P.keys():
    if P[i]>=2:
        P[i]=P[i]*(P[i]+1)/2
print(int(sum(P.values())))

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
N=int(input())
count=0
s=[0 for _ in range(N)]
for i in range(N):
    s[i]=input()
n=['a' for t in range(N) for i in range(t+1,N) if Counter(s[t])==Counter(s[i])]
print(len(n))

Fixed submission:
N=int(input())
S=[''.join(sorted((input()))) for i in range(N)]
P={}
for i in range(N):
    if S[i] in P:
        P[S[i]]+=1
    else:
        P[S[i]]=0
for i in P.keys():
    if P[i]>=2:
        P[i]=P[i]*(P[i]+1)/2
print(int(sum(P.values())))

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
N=int(input())
count=0
s=[0 for _ in range(N)]
for i in range(N):
    s[i]=input()
n=['a' for t in range(N) for i in range(t+1,N) if Counter(s[t])==Counter(s[i])]
print(len(n))

Fixed submission:
N=int(input())
S=[''.join(sorted((input()))) for i in range(N)]
P={}
for i in range(N):
    if S[i] in P:
        P[S[i]]+=1
    else:
        P[S[i]]=0
for i in P.keys():
    if P[i]>=2:
        P[i]=P[i]*(P[i]+1)/2
print(int(sum(P.values())))

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
N=int(input())
count=0
s=[]
for i in range(N):
    s.append(input())
for t in range(N):
    for i in range(t+1,N):
        if Counter(s[t])==Counter(s[i]):
            count+=1
print(int((count)))

Fixed submission:
N=int(input())
S=[''.join(sorted((input()))) for i in range(N)]
P={}
for i in range(N):
    if S[i] in P:
        P[S[i]]+=1
    else:
        P[S[i]]=0
for i in P.keys():
    if P[i]>=2:
        P[i]=P[i]*(P[i]+1)/2
print(int(sum(P.values())))

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
N=int(input())
count=0
s=[]
for i in range(N):
    s.append(input())
for t in range(N):
    for i in range(t+1,N):
        if Counter(s[t])==Counter(s[i]):
            count+=1
print(int((count)))

Fixed submission:
N=int(input())
S=[''.join(sorted((input()))) for i in range(N)]
P={}
for i in range(N):
    if S[i] in P:
        P[S[i]]+=1
    else:
        P[S[i]]=0
for i in P.keys():
    if P[i]>=2:
        P[i]=P[i]*(P[i]+1)/2
print(int(sum(P.values())))

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
N=int(input())
count=0
s=[]
for i in range(N):
    s.append(input())
for t in range(N):
    for i in range(N):
        if t>=i:
            continue
        if Counter(s[t])==Counter(s[i]):
            count+=1
        if i==t:
            count-=1
print(int((count)))

Fixed submission:
N=int(input())
S=[''.join(sorted((input()))) for i in range(N)]
P={}
for i in range(N):
    if S[i] in P:
        P[S[i]]+=1
    else:
        P[S[i]]=0
for i in P.keys():
    if P[i]>=2:
        P[i]=P[i]*(P[i]+1)/2
print(int(sum(P.values())))

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
N=int(input())
s=[0 for _ in range(N)]
count=0
for i in range(N):
    s[i]=input()
for t in range(N):
    for i in range(N):
        if t>=i:
            continue
        if Counter(s[t])==Counter(s[i]):
            count+=1
        if i==t:
            count-=1
print(int((count)))

Fixed submission:
N=int(input())
S=[''.join(sorted((input()))) for i in range(N)]
P={}
for i in range(N):
    if S[i] in P:
        P[S[i]]+=1
    else:
        P[S[i]]=0
for i in P.keys():
    if P[i]>=2:
        P[i]=P[i]*(P[i]+1)/2
print(int(sum(P.values())))

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
N=int(input())
s=[0 for _ in range(N)]
count=0
for i in range(N):
    s[i]=input()
for t in range(N):
    for i in range(N):
        if Counter(s[i])==Counter(s[t]):
            count+=1
print(int((count-N)/2))

Fixed submission:
N=int(input())
S=[''.join(sorted((input()))) for i in range(N)]
P={}
for i in range(N):
    if S[i] in P:
        P[S[i]]+=1
    else:
        P[S[i]]=0
for i in P.keys():
    if P[i]>=2:
        P[i]=P[i]*(P[i]+1)/2
print(int(sum(P.values())))

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
N=int(input())
s=[0 for _ in range(N)]
count=0
for i in range(N):
    s[i]=input()
for t in range(N):
    for i in range(N):
        if Counter(s[i])==Counter(s[t]):
            count+=1
print(int((count-N)/2))

Fixed submission:
N=int(input())
S=[''.join(sorted((input()))) for i in range(N)]
P={}
for i in range(N):
    if S[i] in P:
        P[S[i]]+=1
    else:
        P[S[i]]=0
for i in P.keys():
    if P[i]>=2:
        P[i]=P[i]*(P[i]+1)/2
print(int(sum(P.values())))