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

N = int(input())
count = 0
S = []
for i in range(N):
    S.append([s for s in input()])
for v in itertools.combinations(S, 2):
    v[0].sort()
    v[1].sort()
    if v[0] == v[1]:
        count += 1
if count == 1:
    print(1)
else:
    print(count)

Fixed submission:
import itertools
from math import factorial
from scipy.misc import comb

N = int(input())
s = {}
for _ in range(N):
    b = list(input())
    b.sort()
    c = ''.join(b)
    if not c in s:
        s[c] = 1
    else:
        s[c] += 1

a = [comb(v, 2, exact=True) for v in s.values()]
print(sum(a))

Buggy python submission (verdict: Runtime Error):
from scipy.misc import comb
 
N = int(input())
s = {}
for _ in range(N):
    b = list(input())
    b.sort()
    c = ''.join(b)
    if not b in s:
        s[b] = 1
    else:
        s[b] += 1
 
a = [comb(v, 2, exact=True) for v in s.values()]
print(sum(a))

Fixed submission:
import itertools
from math import factorial
from scipy.misc import comb

N = int(input())
s = {}
for _ in range(N):
    b = list(input())
    b.sort()
    c = ''.join(b)
    if not c in s:
        s[c] = 1
    else:
        s[c] += 1

a = [comb(v, 2, exact=True) for v in s.values()]
print(sum(a))

Buggy python submission (verdict: Runtime Error):
from scipy.misc import comb
 
N = int(input())
s = {}
for _ in range(N):
    b = sorted(input())
    #b.sort()
    #c = ''.join(b)
    if not b in s:
        s[b] = 1
    else:
        s[b] += 1
 
a = [comb(v, 2, exact=True) for v in s.values()]
print(sum(a))

Fixed submission:
import itertools
from math import factorial
from scipy.misc import comb

N = int(input())
s = {}
for _ in range(N):
    b = list(input())
    b.sort()
    c = ''.join(b)
    if not c in s:
        s[c] = 1
    else:
        s[c] += 1

a = [comb(v, 2, exact=True) for v in s.values()]
print(sum(a))

Buggy python submission (verdict: Runtime Error):
import itertools
from math import factorial
from scipy.special import comb

N = int(input())
s = {}
for _ in range(N):
    b = list(input())
    b.sort()
    c = ''.join(b)
    if not c in s:
        s[c] = 1
    else:
        s[c] += 1

a = [comb(v, 2, exact=True) for v in s.values()]
print(sum(a))

Fixed submission:
import itertools
from math import factorial
from scipy.misc import comb

N = int(input())
s = {}
for _ in range(N):
    b = list(input())
    b.sort()
    c = ''.join(b)
    if not c in s:
        s[c] = 1
    else:
        s[c] += 1

a = [comb(v, 2, exact=True) for v in s.values()]
print(sum(a))

Buggy python submission (verdict: Runtime Error):
import itertools
from math import factorial

N = int(input())
s = {}
for _ in range(N):
    b = list(input())
    b.sort()
    c = ''.join(b)
    if not c in s:
        s[c] = 1
    else:
        s[c] += 1

a = [factorial(v) / factorial(2) / factorial(v - 2) for v in s.values()]
print(sum(a))

Fixed submission:
import itertools
from math import factorial
from scipy.misc import comb

N = int(input())
s = {}
for _ in range(N):
    b = list(input())
    b.sort()
    c = ''.join(b)
    if not c in s:
        s[c] = 1
    else:
        s[c] += 1

a = [comb(v, 2, exact=True) for v in s.values()]
print(sum(a))

Buggy python submission (verdict: Runtime Error):
import itertools
from math import factorial

N = int(input())
s = {}
for _ in range(N):
    b = list(input())
    b.sort()
    c = ''.join(b)
    if not c in s:
        s[c] = 1
    else:
        s[c] += 1

a = [int(factorial(v) / factorial(2) / factorial(v - 2)) for v in s.values()]
print(sum(a))

Fixed submission:
import itertools
from math import factorial
from scipy.misc import comb

N = int(input())
s = {}
for _ in range(N):
    b = list(input())
    b.sort()
    c = ''.join(b)
    if not c in s:
        s[c] = 1
    else:
        s[c] += 1

a = [comb(v, 2, exact=True) for v in s.values()]
print(sum(a))

Buggy python submission (verdict: Runtime Error):
import itertools
from math import factorial

N = int(input())
s = {}
for _ in range(N):
    b = list(input())
    b.sort()
    c = ''.join(b)
    if not c in s:
        s[c] = 1
    else:
        s[c] += 1

a = [int(factorial(v) / factorial(2) / factorial(v - 2)) for v in s.values()]
sum(a)

Fixed submission:
import itertools
from math import factorial
from scipy.misc import comb

N = int(input())
s = {}
for _ in range(N):
    b = list(input())
    b.sort()
    c = ''.join(b)
    if not c in s:
        s[c] = 1
    else:
        s[c] += 1

a = [comb(v, 2, exact=True) for v in s.values()]
print(sum(a))

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

N = int(input())
s = []
for _ in range(N):
    b = list(input())
    b.sort()
    c = ''.join(b)
    s.append(c)

count = 0
for v in itertools.combinations(s, 2):
    if v[0] == v[1]:
        count += 1

print(count)

Fixed submission:
import itertools
from math import factorial
from scipy.misc import comb

N = int(input())
s = {}
for _ in range(N):
    b = list(input())
    b.sort()
    c = ''.join(b)
    if not c in s:
        s[c] = 1
    else:
        s[c] += 1

a = [comb(v, 2, exact=True) for v in s.values()]
print(sum(a))