Buggy python submission (verdict: Time Limit Exceeded):
#137c
N = int(input())
sList = []
ans = 0

#文字を読み込みつつ、出現回数を辞書化して、配列に追加
for i in range(N): #2<N<10^5
  # https://www.lifewithpython.com/2015/05/python-count-characters-in-string.html
  string = str(input())

  #辞書化
  #counter = {}
  #for c in string:
  #    if not c in counter:
  #        counter[c] = 1
  #    else:
  #        counter[c] += 1
  #sList.append(counter)
  #↓リスト内包表記なら1行で書ける
  dictionarized_string = {letter: string.count(letter) for letter in string}
  ans += sList.count(dictionarized_string)
  sList.append(dictionarized_string)

  #全通りを比較
  #for i in range(N-1):
  #    for j in range(i+1,N,1):
  #        if sList[i]==sList[j]:
  #            ans = ans+1
  #↑.countで1行で済んだ  

print(ans)

Fixed submission:
#137c
N = int(input())
s_dict = {}
ans = 0

#文字を読み込みつつ、出現回数を辞書化して、辞書に追加
for i in range(N): #2<N<10^5
  # https://www.lifewithpython.com/2015/05/python-count-characters-in-string.html
  string = list(input())
  string.sort(reverse=False)
  
  #print(tuple(string))
    
  if tuple(string) in s_dict:
    s_dict[tuple(string)] += 1
  else:
    s_dict[tuple(string)] = 1

for i in s_dict.values():
  if i != 1:
    ans += sum([i for i in range(1,i)])

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
#137c
N = int(input())
sList = []
ans = 0

#文字を読み込みつつ、出現回数を辞書化して、配列に追加
for i in range(N): #2<N<10^5
    # https://www.lifewithpython.com/2015/05/python-count-characters-in-string.html
    string = str(input())

    #辞書化
    #counter = {}
    #for c in string:
    #    if not c in counter:
    #        counter[c] = 1
    #    else:
    #        counter[c] += 1
    #sList.append(counter)
    #↓リスト内包表記なら1行で書ける
    dictionarized_string = {letter: string.count(letter) for letter in string}
    ans += sList.count(dictionarized_string)
    sList.append(dictionarized_string)
    
#全通りを比較
#for i in range(N-1):
#    for j in range(i+1,N,1):
#        if sList[i]==sList[j]:
#            ans = ans+1
#↑.countで1行で済んだ  

print(ans)

Fixed submission:
#137c
N = int(input())
s_dict = {}
ans = 0

#文字を読み込みつつ、出現回数を辞書化して、辞書に追加
for i in range(N): #2<N<10^5
  # https://www.lifewithpython.com/2015/05/python-count-characters-in-string.html
  string = list(input())
  string.sort(reverse=False)
  
  #print(tuple(string))
    
  if tuple(string) in s_dict:
    s_dict[tuple(string)] += 1
  else:
    s_dict[tuple(string)] = 1

for i in s_dict.values():
  if i != 1:
    ans += sum([i for i in range(1,i)])

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

sList = []
ans = 0

#文字を読み込みつつ、出現回数を辞書化して、配列に追加
for i in range(N):
    # https://www.lifewithpython.com/2015/05/python-count-characters-in-string.html
    string = str(input())
    counter = {}
    
    #辞書化
    for c in string:
        if not c in counter:
            counter[c] = 1
        else:
            counter[c] += 1
            
    sList.append(counter)
    
#全通りを比較
for i in range(N-1):
    for j in range(i+1,N,1):
        if sList[i]==sList[j]:
            ans = ans+1
            
print(ans)

Fixed submission:
#137c
N = int(input())
s_dict = {}
ans = 0

#文字を読み込みつつ、出現回数を辞書化して、辞書に追加
for i in range(N): #2<N<10^5
  # https://www.lifewithpython.com/2015/05/python-count-characters-in-string.html
  string = list(input())
  string.sort(reverse=False)
  
  #print(tuple(string))
    
  if tuple(string) in s_dict:
    s_dict[tuple(string)] += 1
  else:
    s_dict[tuple(string)] = 1

for i in s_dict.values():
  if i != 1:
    ans += sum([i for i in range(1,i)])

print(ans)