Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter

n = int(input())
count = 0
lists =[]
count_dict = Counter()

for i in range(n):
    input_data = ''.join(sorted(input()))
    if input_data in lists:
        count += count_dict[input_data]
        count_dict[input_data] += 1
    else:
        count_dict[input_data] = 1
        lists.append(input_data)

print(count)

Fixed submission:
from collections import Counter

n = int(input())
count = 0
lists =[]
count_dict = Counter()

for i in range(n):
    input_data = ''.join(sorted(input()))
    if input_data in count_dict:
        count += count_dict[input_data]
        count_dict[input_data] += 1
    else:
        count_dict[input_data] = 1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter

def main():
    n = int(input())
    count = 0
    lists =[]
    count_dict = Counter()

    for i in range(n):
        input_data = ''.join(sorted(input()))
        if input_data in lists:
            count += count_dict[input_data]
            count_dict[input_data] += 1
        else:
            count_dict[input_data] = 1
            lists.append(input_data)

    print(count)


if __name__ == '__main__' :
    main()

Fixed submission:
from collections import Counter

n = int(input())
count = 0
lists =[]
count_dict = Counter()

for i in range(n):
    input_data = ''.join(sorted(input()))
    if input_data in count_dict:
        count += count_dict[input_data]
        count_dict[input_data] += 1
    else:
        count_dict[input_data] = 1

print(count)

Buggy python submission (verdict: Runtime Error):
def main():
    n = int(input())
    count = 0
    lists =[]
    count_dict = {}

    for i in range(n):
        input_data = ''.join(sorted(input()))
        if input_data in lists:
            if input_data not in count_dict.keys():
                count_dict[input_data] = 1
        
            count_dict[input_data] += 1
        else:
            lists.append(input_data)

    count = sum(
        v for v in d.values()
    )

    print(count)


if __name__ == '__main__' :
    main()

Fixed submission:
from collections import Counter

n = int(input())
count = 0
lists =[]
count_dict = Counter()

for i in range(n):
    input_data = ''.join(sorted(input()))
    if input_data in count_dict:
        count += count_dict[input_data]
        count_dict[input_data] += 1
    else:
        count_dict[input_data] = 1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())
    count = 0
    lists =[]
    count_dict = {}

    for i in range(n):
        input_data = ''.join(sorted(input()))
        if input_data in lists:
            if input_data not in count_dict.keys():
                count_dict[input_data] = 1
            count += count_dict[input_data]
            count_dict[input_data] += 1
        else:
            lists.append(input_data)

    print(count)


if __name__ == '__main__' :
    main()

Fixed submission:
from collections import Counter

n = int(input())
count = 0
lists =[]
count_dict = Counter()

for i in range(n):
    input_data = ''.join(sorted(input()))
    if input_data in count_dict:
        count += count_dict[input_data]
        count_dict[input_data] += 1
    else:
        count_dict[input_data] = 1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())
    count = 0
    lists =[]
    count_dict = {}

    for i in range(n):
        input_data = ''.join(sorted(input()))
        if input_data in lists:
            if input_data not in count_dict.keys():
                count_dict[input_data] = 1
            count = count + count_dict[input_data]
            count_dict[input_data] += 1
        else:
            lists.append(input_data)

    print(count)


if __name__ == '__main__' :
    main()

Fixed submission:
from collections import Counter

n = int(input())
count = 0
lists =[]
count_dict = Counter()

for i in range(n):
    input_data = ''.join(sorted(input()))
    if input_data in count_dict:
        count += count_dict[input_data]
        count_dict[input_data] += 1
    else:
        count_dict[input_data] = 1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())
    count = 0
    lists =[]
    count_dict = {}

    for i in range(n):
        input_data = ''.join(sorted(input()))
        if input_data in lists:
            if input_data not in count_dict.keys():
                count_dict[input_data] = 1
            count = count + count_dict[input_data]
            count_dict[input_data] = count_dict[input_data] + 1
        else:
            lists.append(input_data)

    print(count)


if __name__ == '__main__' :
    main()

Fixed submission:
from collections import Counter

n = int(input())
count = 0
lists =[]
count_dict = Counter()

for i in range(n):
    input_data = ''.join(sorted(input()))
    if input_data in count_dict:
        count += count_dict[input_data]
        count_dict[input_data] += 1
    else:
        count_dict[input_data] = 1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())
    count = 0
    lists =[]
    count_dict = {}

    for i in range(n):
        input_data = ''.join(sorted(input()))
        if input_data in lists:
            count = count + count_dict[input_data]
            count_dict[input_data] = count_dict[input_data] + 1
        else:
            count_dict[input_data] = 1
            lists.append(input_data)

    print(count)


if __name__ == '__main__' :
    main()

Fixed submission:
from collections import Counter

n = int(input())
count = 0
lists =[]
count_dict = Counter()

for i in range(n):
    input_data = ''.join(sorted(input()))
    if input_data in count_dict:
        count += count_dict[input_data]
        count_dict[input_data] += 1
    else:
        count_dict[input_data] = 1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())
    count = 0
    lists =[]
    count_dict = {}

    for i in range(n):
        input_data = ''.join(sorted(input()))
        if input_data in lists:
            count = count + count_dict[input_data]
            count_dict[input_data] = count_dict[input_data] + 1
            lists.append(input_data)
        else:
            count_dict[input_data] = 1
            lists.append(input_data)

    print(count)


if __name__ == '__main__' :
    main()

Fixed submission:
from collections import Counter

n = int(input())
count = 0
lists =[]
count_dict = Counter()

for i in range(n):
    input_data = ''.join(sorted(input()))
    if input_data in count_dict:
        count += count_dict[input_data]
        count_dict[input_data] += 1
    else:
        count_dict[input_data] = 1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())
    count = 0
    lists =[]

    for i in range(n):
        input_data = ''.join(sorted(input()))
        if input_data in lists:
            count = count + lists.count(input_data)
            lists.append(input_data)
        else:
            lists.append(input_data)

    print(count)


if __name__ == '__main__' :
    main()

Fixed submission:
from collections import Counter

n = int(input())
count = 0
lists =[]
count_dict = Counter()

for i in range(n):
    input_data = ''.join(sorted(input()))
    if input_data in count_dict:
        count += count_dict[input_data]
        count_dict[input_data] += 1
    else:
        count_dict[input_data] = 1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())
    count = 0
    lists =[]

    for i in range(n):
        input_data = ''.join(sorted(input()))
        if input_data in lists:
            count = count + lists.count(input_data)
            lists.append(input_data)
        else:
            lists.append(input_data)

    print(count)


if __name__ == '__main__' :
    main()

Fixed submission:
from collections import Counter

n = int(input())
count = 0
lists =[]
count_dict = Counter()

for i in range(n):
    input_data = ''.join(sorted(input()))
    if input_data in count_dict:
        count += count_dict[input_data]
        count_dict[input_data] += 1
    else:
        count_dict[input_data] = 1

print(count)

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

def main():
    n = int(input())
    c = []
    count = 0
    lists =[]

    for num in range(n):
        c.append(''.join(sorted(input())))

    for i in c:
        if i in lists:
            count = count + lists.count(i)
            lists.append(i)
        else:
            lists.append(i)

    print(count)


if __name__ == '__main__' :
    main()

Fixed submission:
from collections import Counter

n = int(input())
count = 0
lists =[]
count_dict = Counter()

for i in range(n):
    input_data = ''.join(sorted(input()))
    if input_data in count_dict:
        count += count_dict[input_data]
        count_dict[input_data] += 1
    else:
        count_dict[input_data] = 1

print(count)

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

def main():
    n = int(input())
    c = [[] for i in range(n)]
    count = 0
    lists =[]

    for num in range(n):
        c[num] = input()
        c[num] = ''.join(sorted(c[num]))

    for i in c:
        if i in lists:
            count = count + lists.count(i)
            lists.append(i)
        else:
            lists.append(i)

    print(count)


if __name__ == '__main__' :
    main()

Fixed submission:
from collections import Counter

n = int(input())
count = 0
lists =[]
count_dict = Counter()

for i in range(n):
    input_data = ''.join(sorted(input()))
    if input_data in count_dict:
        count += count_dict[input_data]
        count_dict[input_data] += 1
    else:
        count_dict[input_data] = 1

print(count)

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

def main():
    n = int(input())
    c = [[] for i in range(n)]
    count = 0
    for num,i in enumerate(c):
        c[num] = collections.Counter(input())

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

    print(count)


if __name__ == '__main__' :
    main()

Fixed submission:
from collections import Counter

n = int(input())
count = 0
lists =[]
count_dict = Counter()

for i in range(n):
    input_data = ''.join(sorted(input()))
    if input_data in count_dict:
        count += count_dict[input_data]
        count_dict[input_data] += 1
    else:
        count_dict[input_data] = 1

print(count)

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

def main():
    n = int(input())
    s = [[] for i in range(n)]
    count = 0

    for i in range(n):
        s[i] = input()

    for num,i in enumerate(s):
        s[num] = collections.Counter(i)

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

    print(count)


if __name__ == '__main__' :
    main()

Fixed submission:
from collections import Counter

n = int(input())
count = 0
lists =[]
count_dict = Counter()

for i in range(n):
    input_data = ''.join(sorted(input()))
    if input_data in count_dict:
        count += count_dict[input_data]
        count_dict[input_data] += 1
    else:
        count_dict[input_data] = 1

print(count)