Buggy python submission (verdict: Time Limit Exceeded):
import sys
 
n=int(input())
a=[input() for i in range(n)]
 
num = 0
sortedA = []
 
end = len(a) - 1
 
for i in range(0, end):
    if i == 0:
        sortedA.append(''.join(sorted(a[0])))
    for j in range(i + 1, end + 1):
        if i == 0:
            sortedA.append(''.join(sorted(a[j])))
        if sortedA[i] == sortedA[j]:
            num = num + 1
print(num)

Fixed submission:
import sys
import collections

n=int(input())
a=[''.join(sorted(input())) for _ in range(n)]

ans = 0
for v in collections.Counter(a).values():
    if v != 1:
        ans += v * (v - 1) // 2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
 
n=int(input())
a=[input() for i in range(n)]

num = 0
sortedA = []

end = len(a) - 1

for i in range(0, end):
    if i == 0:
        sortedA.append(''.join(sorted(a[0])))
    for j in range(i + 1, end + 1):
        if i == 0:
            sortedA.append(''.join(sorted(a[j])))
        if sortedA[i] == sortedA[j]:
            num = num + 1
print(num)

Fixed submission:
import sys
import collections

n=int(input())
a=[''.join(sorted(input())) for _ in range(n)]

ans = 0
for v in collections.Counter(a).values():
    if v != 1:
        ans += v * (v - 1) // 2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
 
a = []
for l in sys.stdin:
    if l == '\n':
        break
    else :
        a.append(l)

num = 0
sortedA = []

end = len(a) - 1

for i in range(0, end):
    if i == 0:
        sortedA.append(''.join(sorted(a[1])))
    for j in range(i + 1, end):
        if i == 0:
            sortedA.append(''.join(sorted(a[j + 1])))
        if sortedA[i] == sortedA[j]:
            num = num + 1
print(num)

Fixed submission:
import sys
import collections

n=int(input())
a=[''.join(sorted(input())) for _ in range(n)]

ans = 0
for v in collections.Counter(a).values():
    if v != 1:
        ans += v * (v - 1) // 2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
 
a = []
for l in sys.stdin:
    if l == '\n' or l == '\r':
        break
    else :
        a.append(l)

target = a[int(a[0])]
num = 0
sortedA = []

end = len(a) - 1

for i in range(0, end):
    if i == 0:
        sortedA.append(''.join(sorted(a[1])))
    for j in range(i + 1, end):
        if i == 0:
            sortedA.append(''.join(sorted(a[j + 1])))
        if sortedA[i] == sortedA[j]:
            num = num + 1
print(num)

Fixed submission:
import sys
import collections

n=int(input())
a=[''.join(sorted(input())) for _ in range(n)]

ans = 0
for v in collections.Counter(a).values():
    if v != 1:
        ans += v * (v - 1) // 2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
 
a = []
for l in sys.stdin:
    a.append(l)
 
target = a[int(a[0])]
num = 0

sortedA = []

for i in a:
    sortedA.append(''.join(sorted(i)))
sortedA.pop(0)

end = len(a) - 1

for i in range(0, end):
    for j in range(i + 1, end):
        if sortedA[i] == sortedA[j]:
            num = num + 1
print(num)

Fixed submission:
import sys
import collections

n=int(input())
a=[''.join(sorted(input())) for _ in range(n)]

ans = 0
for v in collections.Counter(a).values():
    if v != 1:
        ans += v * (v - 1) // 2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
 
a = []
for l in sys.stdin:
    a.append(l)
 
target = a[int(a[0])]
num = 0

sortedA = []

for i in a:
    sortedA.append(''.join(sorted(i)))
sortedA.pop(0)

for i in range(0, len(a) - 1):
    for j in range(i + 1, len(a) - 1):
        if sortedA[i] == sortedA[j]:
            num = num + 1
print(num)

Fixed submission:
import sys
import collections

n=int(input())
a=[''.join(sorted(input())) for _ in range(n)]

ans = 0
for v in collections.Counter(a).values():
    if v != 1:
        ans += v * (v - 1) // 2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
 
a = []
for l in sys.stdin:
    if l == '\n' or l == '\r':
        break
    else :
        a.append(l)
 
target = a[int(a[0])]
num = 0

sortedA = []

for i in a:
    sortedA.append(''.join(sorted(i)))
sortedA.pop(0)

for i in range(0, len(a) - 1):
    for j in range(i + 1, len(a) - 1):
        flag = False
        if sortedA[i] == sortedA[j]:
            flag = True
            num = num + 1
print(num)

Fixed submission:
import sys
import collections

n=int(input())
a=[''.join(sorted(input())) for _ in range(n)]

ans = 0
for v in collections.Counter(a).values():
    if v != 1:
        ans += v * (v - 1) // 2
print(ans)

Buggy python submission (verdict: Runtime Error):
import sys
 
a = []
for l in sys.stdin:
    if l == '\n' or l == '\r' or l == '\r\n':
        break
    else :
        a.append(l)
 
target = a[int(a[0])]
num = 0

sortedA = []

for i in a:
    sortedA.append(''.join(sorted(a[i])))
sortedA.pop(0)

for i in range(1, len(a) - 1):
    for j in range(i + 1, len(a)):
        flag = False
        if sortedA[i]==sortedA[j]:
            flag = True
        else:
            flag = False
        if flag:
            num = num + 1
print(num)

Fixed submission:
import sys
import collections

n=int(input())
a=[''.join(sorted(input())) for _ in range(n)]

ans = 0
for v in collections.Counter(a).values():
    if v != 1:
        ans += v * (v - 1) // 2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
 
a = []
for l in sys.stdin:
    if l == '\n' or l == '\r' or l == '\r\n':
        break
    else :
        a.append(l)
 
target = a[int(a[0])]
num = 0
for i in range(1, len(a) - 1):
    for j in range(i + 1, len(a)):
        flag = False
        iStrSorted = ''.join(sorted(a[i]))
        jStrSorted = ''.join(sorted(a[j]))
        if iStrSorted==jStrSorted:
            flag = True
        else:
            flag = False
        if flag:
            num = num + 1
print(num)

Fixed submission:
import sys
import collections

n=int(input())
a=[''.join(sorted(input())) for _ in range(n)]

ans = 0
for v in collections.Counter(a).values():
    if v != 1:
        ans += v * (v - 1) // 2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import sys

a = []
for l in sys.stdin:
    if l == '\n':
        break
    else :
        a.append(l)

target = a[int(a[0])]
num = 0
for i in range(1, len(a) - 1):
    for j in range(i + 1, len(a)):
        flag = False
        iStrSorted = ''.join(sorted(a[i]))
        jStrSorted = ''.join(sorted(a[j]))
        if iStrSorted==jStrSorted:
            flag = True
        else:
            flag = False
        if flag:
            num = num + 1
print(num)

Fixed submission:
import sys
import collections

n=int(input())
a=[''.join(sorted(input())) for _ in range(n)]

ans = 0
for v in collections.Counter(a).values():
    if v != 1:
        ans += v * (v - 1) // 2
print(ans)

Buggy python submission (verdict: Runtime Error):
import sys

a = []
for l in sys.stdin:
    if l == '\n':
        break
    else :
        a.append(l)

target = a[int(a[0])]
num = 0
for i in range(1, len(a) - 1):
    for j in range(i + 1, len(a)):
        flag = False
        iStrSorted = ''.join(sorted(a[i]))
        jStrSorted = ''.join(sorted(a[j]))]
        if iStrSorted==jStrSorted:
            flag = True
        else:
            flag = False
        if flag:
            num = num + 1
print(num)

Fixed submission:
import sys
import collections

n=int(input())
a=[''.join(sorted(input())) for _ in range(n)]

ans = 0
for v in collections.Counter(a).values():
    if v != 1:
        ans += v * (v - 1) // 2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import sys

a = []
for l in sys.stdin:
    if l == '\n':
        break
    else :
        a.append(l)

target = a[int(a[0])]
num = 0
for i in range(1, len(a) - 1):
    for j in range(i + 1, len(a)):
        flag = False
        for s in range(0, len(a[i]) - 1):
            if a[i].count(a[i][s]) == a[j].count(a[i][s]):
                flag = True
            else:
                flag = False
                break
        if flag:
            num = num + 1
print(num)

Fixed submission:
import sys
import collections

n=int(input())
a=[''.join(sorted(input())) for _ in range(n)]

ans = 0
for v in collections.Counter(a).values():
    if v != 1:
        ans += v * (v - 1) // 2
print(ans)

Buggy python submission (verdict: Runtime Error):
import sys

a = []
for l in sys.stdin:
    if l == '\n':
        break
    else :
        a.append(l)

target = a[int(a[0])]
print(target)

outNum = []
i1 = 0
for item in range(0, int(a[0]) - 1):
    if i1 != 0:
        for i in range(0, len(target) - 1):
            flag = False
            if target.count(target[i]) == item.count(target[i]):
                print(item)
                flag = True
            else:
                break
        if flag:
            outNum.append(item)
    i1 = i1 + 1
    flag = False
print(len(outNum))      



Fixed submission:
import sys
import collections

n=int(input())
a=[''.join(sorted(input())) for _ in range(n)]

ans = 0
for v in collections.Counter(a).values():
    if v != 1:
        ans += v * (v - 1) // 2
print(ans)