Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
# -*- coding: <encoding name> -*-

import math
n = map(int, input())
print(math.ceil(n / 2))

Fixed submission:
# -*- coding: <encoding name> -*-

import math
n = int(input())
print(math.ceil(n / 2))

Buggy python submission (verdict: Runtime Error):
# -*- coding: <encoding name> -*-

import math
n = map(int, input())
print(math.ceil(n / 2)

Fixed submission:
# -*- coding: <encoding name> -*-

import math
n = int(input())
print(math.ceil(n / 2))

Buggy python submission (verdict: Runtime Error):
# -*- coding: <encoding name> -*-

import math
n = map(int, input().split())
print(math.ceil(n / 2)

Fixed submission:
# -*- coding: <encoding name> -*-

import math
n = int(input())
print(math.ceil(n / 2))
Buggy python submission (verdict: Runtime Error):
# -*- coding: <encoding name> -*-

n, k = map(int, input().split())
h = list(map(int, input().split()))

count = 0

for i in h:
	if i >= k:
		count++

print(count)

Fixed submission:
# -*- coding: <encoding name> -*-

n, k = map(int, input().split())
h = list(map(int, input().split()))

count = 0

for i in h:
	if i >= k:
		count += 1

print(count)

Buggy python submission (verdict: Runtime Error):
# -*- coding: <encoding name> -*-

n, k = map(int, input().split())
h = list(map(int, input().split()))

count = 0

for i in h:
	if i >=:
		count++

print(count)

Fixed submission:
# -*- coding: <encoding name> -*-

n, k = map(int, input().split())
h = list(map(int, input().split()))

count = 0

for i in h:
	if i >= k:
		count += 1

print(count)
Buggy python submission (verdict: Runtime Error):
# -*- coding: <encoding name> -*-

import math
a, b = map(int, input().split())
# range = d * 2 + 1
# c == 1 + a * n - n >= b
print(math.ceil((b - 1) / (a - 1))

Fixed submission:
# -*- coding: <encoding name> -*-

import math
a, b = map(int, input().split())
# range = d * 2 + 1
# c == 1 + a * n - n >= b
print(math.ceil((b - 1) / (a - 1)))
Buggy python submission (verdict: Runtime Error):
# -*- coding: <encode name> -*-

r = int(input())
input(3 * (r ** 2))

Fixed submission:
# -*- coding: <encode name> -*-

r = int(input())
print(3 * r * r)

Buggy python submission (verdict: Runtime Error):
# -*- coding: <encode name> -*-

r = int(input())
input(3 * r * r)

Fixed submission:
# -*- coding: <encode name> -*-

r = int(input())
print(3 * r * r)
Buggy python submission (verdict: Runtime Error):
# -*- coding: <encoding name> -*-

import math
n, d = map(int, input())
range = d * 2 + 1
print(math.ceil(n / range))

Fixed submission:
# -*- coding: <encoding name> -*-

import math
n, d = map(int, input().split())
range = d * 2 + 1
print(math.ceil(n / range))
Buggy python submission (verdict: Runtime Error):
# -*- coding: <encoding name> -*-
'''
T, X = int(input())
print(T / X)
'''
 T, X = map(int, input().split())
 print(T / X)

Fixed submission:
# -*- coding: <encoding name> -*-
'''
T, X = int(input())
print(T / X)
'''
T, X = map(int, input().split())
print(T / X)

Buggy python submission (verdict: Runtime Error):
# -*- coding: <encoding name> -*-
'''
T, X = int(input())
print(T / X)
'''
 T, X = map(int, input().split())
 print(T / X)

Fixed submission:
# -*- coding: <encoding name> -*-
'''
T, X = int(input())
print(T / X)
'''
T, X = map(int, input().split())
print(T / X)

Buggy python submission (verdict: Runtime Error):
# -*- coding: <encoding name> -*-
'''
T, X = int(input())
print(T / X)
'''
 T, X = map(int(input()))
 print(T / X)



Fixed submission:
# -*- coding: <encoding name> -*-
'''
T, X = int(input())
print(T / X)
'''
T, X = map(int, input().split())
print(T / X)

Buggy python submission (verdict: Runtime Error):
# -*- coding: <encoding name> -*-

T, X = int(input())
print(T / X)

Fixed submission:
# -*- coding: <encoding name> -*-
'''
T, X = int(input())
print(T / X)
'''
T, X = map(int, input().split())
print(T / X)
Buggy python submission (verdict: Runtime Error):
# -*- coding: <encoding name> -*-

X, Y = map(int, input())
print(X + Y // 2)

Fixed submission:
# -*- coding: <encoding name> -*-

X, Y = map(int, input().split())
print(X + Y // 2)
Buggy python submission (verdict: Runtime Error):
# -*- coding: <encoding name> -*-

a, b, c = map(int, input().split())
print('Yes' if A + B >= C else 'No')

Fixed submission:
# -*- coding: <encoding name> -*-

a, b, c = map(int, input().split())
print('Yes' if a + b >= c else 'No')

Buggy python submission (verdict: Runtime Error):
# -*- coding: <encoding name> -*-

a, b, c = map(int, input().split())
print('Yes' if A + B >= C else 'No')

Fixed submission:
# -*- coding: <encoding name> -*-

a, b, c = map(int, input().split())
print('Yes' if a + b >= c else 'No')
Buggy python submission (verdict: Runtime Error):
# -*- coding: <encoding name> -*-

line_1 = input
line_2 = input
line = line_1 + line_2
print('YES' if line == line[::-1] else 'NO')

Fixed submission:
# -*- coding: <encoding name> -*-

line_1 = input()
line_2 = input()
line = line_1 + line_2
print('YES' if line == line[::-1] else 'NO')
Buggy python submission (verdict: Runtime Error):
# -*- coding: <encoding name> -*-

a, b, c = map(int, input())
print('a' if b ==c else 'b' if c == a else 'c')

Fixed submission:
# -*- coding: <encoding name> -*-

a, b, c = map(int, input().split())
print(a if b ==c else b if c == a else c)
Buggy python submission (verdict: Runtime Error):
# -*- coding: <encoding name> -*-

n = int(input())
if '9' in n:
	print('Yes')
else:
	print('No')

Fixed submission:
# -*- coding: <encoding name> -*-

n = input()
if '9' in n:
	print('Yes')
else:
	print('No')

Buggy python submission (verdict: Runtime Error):
# -*- coding: <encoding name> -*-

n = int(input())
if 9 in n:
	print('Yes')
else:
	print('No')

Fixed submission:
# -*- coding: <encoding name> -*-

n = input()
if '9' in n:
	print('Yes')
else:
	print('No')
Buggy python submission (verdict: Runtime Error):
# -*- coding: <encoding name> -*-

n = int(input())
a = list(map(int(), input().split()))

A = sorted(a)
print(A[-1] - A[0])

Fixed submission:
# -*- coding: <encoding name> -*-

n = int(input())
a = list(map(int, input().split()))

A = sorted(a)
print(A[-1] - A[0])

Buggy python submission (verdict: Runtime Error):
# -*- coding: <encoding name> -*-

n = int(input())
a = list[map(int(), input().split())]

A = sorted(a)
print(A[-1] - A[0])

Fixed submission:
# -*- coding: <encoding name> -*-

n = int(input())
a = list(map(int, input().split()))

A = sorted(a)
print(A[-1] - A[0])
Buggy python submission (verdict: Runtime Error):
S = input().split()

if S[0] == S[1] == S[2]:
    print('No')
else:
    print('Yes')

Fixed submission:
S = input()

if S[0] == S[1] == S[2]:
    print('No')
else:
    print('Yes')
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if e - a <= k:
    print('Yay!')
else:
    print(':(')


Fixed submission:
b = str(input())
if b == 'A':
    print('T')
elif b == 'C':
    print('G')
elif b == 'G':
    print('C')
else:
    print('A')
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())

l = list()
for i in range(m):
  k = int(input())
  l.append(k)
s = sum(l)

ans = n-s
if ans>=0:
  print(ans)
else:
  print(-1)

Fixed submission:
n,m = map(int,input().split())

l = list(map(int,input().split()))

s = sum(l)

ans = n-s
if ans>=0:
  print(ans)
else:
  print(-1)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
l=list(map(int,input().split()))

for i in range(1,n+1):
    print(l.count(i))

Fixed submission:
n=int(input())
l=list(map(int,input().split()))
k = [0]*n
for i in range(len(l)):
    c = l[i]
    k[c-1] = k[c-1]+1
for j in range(len(k)):
    print(k[j])
Buggy python submission (verdict: Runtime Error):
n = int(input)
add = 0
for i in range(n):
  if i%3!=0:
    if i%5!=0:
      add += i
print(i)

Fixed submission:
n = int(input())
add = 0
for i in range(1, n+1):
  if i%3!=0:
    if i%5!=0:
      add += i
print(add)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()

ans = 0
for a in range(0,n-2):
    for b in range(a,n-1):
        e = b-a
        #if s[a]!=s[b]:
        for c in range(b,n):
            f = c-b
            if e!=f:
                if s[a]!=s[c] and s[b]!=s[c] and s[a]!=s[b]:
                    ans += 1

print(ans)

Fixed submission:
n = int(input())
s = input()

r = s.count("R")
g = s.count("G")
b = s.count("B")
ans = r*g*b

for i in range(n):
    for j in range(1,n//2+1):
        if i+2*j>=n:
            break
        
        if s[i]!=s[i+j] and s[i+j]!=s[i+2*j] and s[i]!=s[i+2*j]:
            ans -= 1
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()

ans = 0
for a in range(0,n-2):
    for b in range(a,n-1):
        e = b-a
        #if s[a]!=s[b]:
            for c in range(b,n):
                f = c-b
                if e!=f:
                    if s[a]!=s[c] and s[b]!=s[c] and s[a]!=s[b]:
                        ans += 1

print(ans)

Fixed submission:
n = int(input())
s = input()

r = s.count("R")
g = s.count("G")
b = s.count("B")
ans = r*g*b

for i in range(n):
    for j in range(1,n//2+1):
        if i+2*j>=n:
            break
        
        if s[i]!=s[i+j] and s[i+j]!=s[i+2*j] and s[i]!=s[i+2*j]:
            ans -= 1
print(ans)

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

ans = 0
for a in range(0,n-2):
    for b in range(a,n-1):
        e = b-a
        if s[a]!=s[b]:
            for c in range(b,n):
                f = c-b
                if e!=f:
                    if s[a]!=s[c] and s[b]!=s[c]:
                        ans += 1

print(ans)

Fixed submission:
n = int(input())
s = input()

r = s.count("R")
g = s.count("G")
b = s.count("B")
ans = r*g*b

for i in range(n):
    for j in range(1,n//2+1):
        if i+2*j>=n:
            break
        
        if s[i]!=s[i+j] and s[i+j]!=s[i+2*j] and s[i]!=s[i+2*j]:
            ans -= 1
print(ans)

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

ans = 0
for a in range(0,n-2):
    for b in range(a,n-1):
        e = b-a
        if s[a]!=s[b]:
            for c in range(b,n):
                f = c-b
                if e!=f:
                    if s[a]!=s[c] and s[b]!=s[c]:
                        ans += 1

print(ans)

Fixed submission:
n = int(input())
s = input()

r = s.count("R")
g = s.count("G")
b = s.count("B")
ans = r*g*b

for i in range(n):
    for j in range(1,n//2+1):
        if i+2*j>=n:
            break
        
        if s[i]!=s[i+j] and s[i+j]!=s[i+2*j] and s[i]!=s[i+2*j]:
            ans -= 1
print(ans)
Buggy python submission (verdict: Runtime Error):
k, x = map(int, input().sprit())
if k*500>=x:
  print('Yes')
else:
  print('No')

Fixed submission:
k, x = map(int, input().split())
if k*500>=x:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
s = int(input())
if s =="SUN":
  print(7)
elif s =="MON":
  print(6)
elif s=="TUE":
  print(5)
elif s =="WED":
  print(4)
elif s=="THU":
  print(3)
elif s=="FRI":
  print(2)
else:print(1)

Fixed submission:
s = input()
if s =="SUN":
    print(7)
elif s =="MON":
    print(6)
elif s=="TUE":
    print(5)
elif s =="WED":
    print(4)
elif s=="THU":
    print(3)
elif s=="FRI":
    print(2)
else:print(1)
Buggy python submission (verdict: Runtime Error):
n=int(input())
S=list(map(int,input().split()))
c=0

print(n,S)

for i in range(7):
    for j in range(7):
        if i!=j:
            c+=S[i]*S[j]


print(int(c/2))

Fixed submission:
n=int(input())
S=list(map(int,input().split()))
c=0

for i in range(n):
    for j in range(n):
        if i!=j:
            c+=S[i]*S[j]


print(int(c/2))
Buggy python submission (verdict: Time Limit Exceeded):
N = input()
A = list(map(int, input().split()))
ans = []

for i in range(len(A)):
    ans.append(A.index(i+1)+1)
print(*ans)

Fixed submission:
import numpy as np

N = input()
A = list(map(int, input().split()))
ans = np.argsort(A)
print(*np.array(ans)+1)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(input()) for i in range(N)]
max = [0]*N

for i in range(N):
    for j in range(N):
        if i != j:    
            if max[i] < A[j]:
                max[i] = A[j]

for i in range(N):
    print(max[i])

Fixed submission:
N = int(input())
A = [int(input()) for i in range(N)]
B = sorted(A, reverse=True)

for i in range(N):
    if B[0] == A[i]:
        print(B[1])
    else:
        print(B[0])
Buggy python submission (verdict: Runtime Error):
L,R = map(int, input().split())
MIN = 2019
for i in range(L,R):
    for j in range(i+1, R+1):
        mod = ij % 2019

        if MIN > mod:
            MIN = mod
 
print(MIN)

Fixed submission:
N,A,B = map(int, input().split())
if N*A >= B:
    print(B)
else:
    print(N*A)

Buggy python submission (verdict: Runtime Error):
L,R = map(int, input().split())
MIN = R*2
for i in range(L,R):
    for j in range(i+1, R+1):
        mod = ij % 2019

        if MIN > mod:
            MIN = mod
 
print(MIN)

Fixed submission:
N,A,B = map(int, input().split())
if N*A >= B:
    print(B)
else:
    print(N*A)
Buggy python submission (verdict: Runtime Error):
T,X = map(int, input().split(" "))
print({T/X:.5f})

Fixed submission:
T,X = map(int, input().split())
print(T/X)

Buggy python submission (verdict: Runtime Error):
T,X = map(int, input().split(" "))
print(f"{T/X:.5f})

Fixed submission:
T,X = map(int, input().split())
print(T/X)
Buggy python submission (verdict: Runtime Error):
t=input()
import math
print (math.log(t)-math.log(100))/math.log(1.01)

Fixed submission:
t=int(input())
k=100000
p=100
for i in range(1,k):
	p=int(p*1.01)
	if (p>=t):
		print (i)
		break
Buggy python submission (verdict: Time Limit Exceeded):
# 視点を変えてやる全探索 000~999までが達成できたらおｋ
n = int(input())
s = list(input())
ans = 0
for i in range(1000):
    t = list(f"{i:0>3}")
    j = 0
    tmp = ""
    for c in s:
        if t[j] == c:
            j += 1
        if j == 3:
            ans += 1
            break
print(ans)

Fixed submission:
# 視点を変えてやる全探索 000~999までが達成できたらおｋ
n = int(input())
s = list(input())
ans = 0
for i in range(1000):
    t = list(f"{i:0>3}")
    j = 0
    tmp = ""
    for c in s:
        if t[j] == c:
            j += 1
        if j == 3:
            ans += 1
            break
print(ans)
Buggy python submission (verdict: Runtime Error):
# 真ん中を通れば必ず二分できてこれが最大値だが、自分自身が真ん中の座標の場合は自分自信を通るどんな直線も二分できる
w, h, x, y = map(int, input().split())
ans1 = (w * h) / 2.0
ans2 = 1 if w // x == h // y == 2 else 0
print(ans1, ans2)


Fixed submission:
# 真ん中を通れば必ず二分できてこれが最大値だが、自分自身が真ん中の座標の場合は自分自信を通るどんな直線も二分できる
w, h, x, y = map(int, input().split())
ans1 = (w * h) / 2.0
ans2 = 1 if w / 2 == x and h / 2 == y else 0
print(ans1, ans2)

Buggy python submission (verdict: Runtime Error):
# 結局平行線か45度かのminな気がする 真ん中は(H+W-2)
# 頂点にある場合もある
w, h, x, y = map(int, input().split())
ans = 0
if 0 == x or x == w and 0 == y or y == h:
    ans = min(w / 2, h / 2)
    print(ans, endl=" ")
    print(1 if w == h else 0)
    exit()
if 0 == x or x == w:
    # y軸で切る or 0かwの近い方への差
    if y < h // 2:
        ans = min(y * w, y / 2)
    else:
        ans = min((h - y) * y, (h - y) / 2)
elif 0 == y or y == h:
    # x軸で切る
    if x < w // 2:
        ans = min(x * h, x / 2)
    else:
        ans = min((w - x) * x, (w - x) / 2)

if ans != 0:
    print(ans, 0)
else:
    if x == w/2 or y == h/2:
        if w == y:
            # 真ん中
            print(x * y, 1)
        else:
            print(min(x * y, (w - x) * y, (h - y) * x), 1)
    else:
        print(min([y * w, y / 2, (h - y) * y, (h - y) / 2,
                   x * h, x / 2, (w - x) * x, (w - x) / 2]), 0)


Fixed submission:
# 真ん中を通れば必ず二分できてこれが最大値だが、自分自身が真ん中の座標の場合は自分自信を通るどんな直線も二分できる
w, h, x, y = map(int, input().split())
ans1 = (w * h) / 2.0
ans2 = 1 if w / 2 == x and h / 2 == y else 0
print(ans1, ans2)
Buggy python submission (verdict: Runtime Error):
n = int(input())
ans = 0
for _ in range(n):
    x, y = map(int, input().split())
    if y == "JPY":
        ans += x
    else:
        ans += 380000
print(ans)


Fixed submission:
n = int(input())
ans = 0
for _ in range(n):
    x, y = input().split()
    x = float(x)
    if y == "JPY":
        ans += x
    else:
        ans += x * 380000.0
print(ans)
Buggy python submission (verdict: Runtime Error):
# マジで納得がいかねぇので01がなんのケースなのかわざわざ調べてやる

n, m = map(int, input().split())

if n == 1 or m == 1:  # どうせこれだろ
    print(f"kasu")
    print(1 / 0)


Fixed submission:
# 書けばわかる 裏になるのは奇数回訪れる場所
n, w = map(int, input().split())
print(abs(n*w-(2*n+2*w-4)))
Buggy python submission (verdict: Time Limit Exceeded):
# 毎回やってもたかがしれてそう 包除原理
q = int(input())


def isPrime(x):
    if x == 1:
        return False
    for i in range(2, int(x ** 0.5) + 1):
        # print("{}%{}".format(x, i))
        if x % i == 0:
            return False
    return True


for _ in range(q):
    l, r = map(int, input().split())
    if l % 2 == 0:
        l += 1
    count = 0
    for x in range(l, r + 1, 2):
        # print("x={}".format(x))
        if isPrime(x) and isPrime((x + 1) // 2):
            count += 1
    print(count)


Fixed submission:
# 毎回やってもたかがしれてそう -> 間に合いませんでした
# 素直に累積和+包除原理を使う

arr = [0 for _ in range(10 ** 5 + 1)]


def isPrime(x):
    if x == 1:
        return False
    for i in range(2, int(x ** 0.5) + 1):
        if x % i == 0:
            return False
    return True


for i in range(3, 10**5+1):
    if isPrime(i) and isPrime(int((i + 1) / 2)):
        arr[i] = 1
    arr[i] += arr[i-1]

q = int(input())


for _ in range(q):
    l, r = map(int, input().split())
    print(arr[r] - arr[l-1])
Buggy python submission (verdict: Runtime Error):
# ハッシュで数えてキーでソートして+-1を全探索
n = int(input())
arr = list(map(int, input().split()))
hash = dict()
for a in arr:
    if a in hash:
        hash[a] += 1
    else:
        hash[a] = 1

lis = list(sorted(hash.items(), key=lambda x: x[0]))

ans = 0
for i in range(1, n - 2):
    temp = lis[i][1]
    if lis[i - 1][0] + 1 == lis[i][0]:
        temp += lis[i - 1][1]
    if lis[i + 1][0] - 1 == lis[i][0]:
        temp += lis[i + 1][1]
    ans = max(ans, temp)

print(ans)


Fixed submission:
# ハッシュで数えてキーでソートして+-1を全探索
# と思ったけど登場してないやつでもいける 3 5 なら4が2個になるのでN個から全探索

n = int(input())
arr = list(map(int, input().split()))
lis = [0 for _ in range(10**5+1)]
hash = dict()
for a in arr:
    lis[a] += 1

ans = 1
for i in range(1, 10**5):
    ans = max(ans, lis[i-1]+lis[i]+lis[i+1])

print(ans)
Buggy python submission (verdict: Runtime Error):
# 全域木？っていうんだっけ？でもコストは関係ないか
# 適当に隣接リストでもってしてDFSする
N, M = map(int, input().split())
Neighbor_list = [[] for _ in range(n)]
for _ in range(M):
    s, t = map(int, input().split())
    Neighbor_list[s-1].append(t-1)
    Neighbor_list[t-1].append(s-1)


def dfs(cur, path):
    if len(path) == N:
        return 1
    else:
        ret = 0
        for neighbor in Neighbor_list[cur]:
            if neighbor not in path:
                next_list = path[:]
                next_list.append(neighbor)
                ret += dfs(neighbor, next_list)
        return ret


print(dfs(0, []))


Fixed submission:
# 全域木？っていうんだっけ？でもコストは関係ないか
# 適当に隣接リストでもってしてDFSする
N, M = map(int, input().split())
Neighbor_list = [[] for _ in range(N)]
for _ in range(M):
    s, t = map(int, input().split())
    Neighbor_list[s-1].append(t-1)
    Neighbor_list[t-1].append(s-1)


def dfs(cur, path):
    if len(path) == N:
        return 1
    else:
        ret = 0
        for neighbor in Neighbor_list[cur]:
            if neighbor not in path:
                next_list = path[:]
                next_list.append(neighbor)
                ret += dfs(neighbor, next_list)
        return ret


print(dfs(0, [0]))
Buggy python submission (verdict: Time Limit Exceeded):
import itertools, bisect

N = int(input())
L = list(map(int, input().split()))
L.sort()

ans = 0
for i in range(N):
    for j in range(i+1, N):
        cindex = bisect.bisect_left(L, int(L[i]) + int(L[j]))
        for _ in reversed(range(j+1, cindex)):
            ans += 1

print(ans)

Fixed submission:
import itertools, bisect

N = int(input())
L = list(map(int, input().split()))
L.sort()

ans = 0
for i in range(N):
    for j in range(i+1, N):
        cindex = bisect.bisect_left(L, int(L[i]) + int(L[j]))
        ans += cindex-1 - j

print(ans)

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

N = int(input())
L = input().split()

cand = itertools.combinations(L,3)

ans = 0
for c in cand:
    a, b, c = int(c[0]), int(c[1]), int(c[2])
    if a < b + c and b < a + c and c < a + b:
        ans += 1

print(ans)


Fixed submission:
import itertools, bisect

N = int(input())
L = list(map(int, input().split()))
L.sort()

ans = 0
for i in range(N):
    for j in range(i+1, N):
        cindex = bisect.bisect_left(L, int(L[i]) + int(L[j]))
        ans += cindex-1 - j

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
slist = []
for i in range(N):
    slist.append(''.join(sorted(list(input()))))

i = 0
count = 0
for s in slist:
    i += 1
    for target in slist[i:]:
        if target == s:
            count += 1

print(count)


Fixed submission:
from scipy.special import comb

N = int(input())
sdict = {}
for i in range(N):
    inp = ''.join(sorted(list(input())))
    if inp not in sdict:
        sdict.update({inp:1})
    else:
        sdict[inp] += 1

ans = 0
for key in sdict:
    ans += comb(sdict[key], 2 , exact=True)

print(ans)
Buggy python submission (verdict: Runtime Error):
N, X = map(int, input().split())
L = [int(i) for i in input().split()]
 
ans = 0
D = [0] * (N + 1)
for i in range(2, N+2):
    if i != 0:
        D[i] = D[i-1] + L[i-1]
    if D[i] <= X:
        ans += 1
    else:
        break
print(ans)


Fixed submission:
N, X = map(int, input().split())
L = [int(i) for i in input().split()]
 
ans = 1
now = 0
for i in range(N):
    now = now + L[i]
    if now <= X:
        ans += 1
    else:
        break
print(ans)

Buggy python submission (verdict: Runtime Error):
N, X = map(int, input().split())
L = [int(i) for i in input().split()]

ans = 0
D = [0] * (N + 2)
for i in range(N+2):
    if i != 1:
        D[i] = D[i-1] + L[i-1]
    if D[i] <= X:
        ans += 1
    else:
        break
print(ans)

Fixed submission:
N, X = map(int, input().split())
L = [int(i) for i in input().split()]
 
ans = 1
now = 0
for i in range(N):
    now = now + L[i]
    if now <= X:
        ans += 1
    else:
        break
print(ans)