Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
n = int(input())
a = list(input().split())
c = Counter(a)
c = list(c.items())
x = []
y = []
for i in range(len(c)):
    x.append(c[i][0])
    y.append(c[i][1])
ans = 0
for i in range(len(c)):
    ans += y[i] * (y[i] - 1) // 2
for i in range(n):
    print(ans - (y[x.index(a[i])] - 1))

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
b = [0] * (n + 1)
for i in range(n):
    b[a[i]] += 1
ans = 0
for i in range(len(b)):
    ans += b[i] * (b[i]-1) // 2
for i in range(n):
    print(ans - (b[a[i]] - 1))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
x = []
y = []
for i in range(n):
    if a[i] in x:
        y[x.index(a[i])] += 1
    else:
        x.append(a[i])
        y.append(1)
ans = 0
for i in range(len(y)):
    if y[i] >= 2:
        ans += y[i] * (y[i] - 1) // 2
for i in range(n):
    print(ans - (y[x.index(a[i])] - 1))

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
b = [0] * (n + 1)
for i in range(n):
    b[a[i]] += 1
ans = 0
for i in range(len(b)):
    ans += b[i] * (b[i]-1) // 2
for i in range(n):
    print(ans - (b[a[i]] - 1))
Buggy python submission (verdict: Runtime Error):
k = int(input)
l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(l[k-1])

Fixed submission:
k = int(input())
li = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(li[k-1])
Buggy python submission (verdict: Runtime Error):
A,B = map(int,input().split())

C = A / 0.08
D = B / 0.1

if int(C * 0.1) == B:
    if int(D * 0.08) == A:
        print(min(int(C),int(D)))
    else:
        print(int(C))
elif int(D * 0.08) == A:
    print(int(D))
else:
    print(-1)

Fixed submission:
s = input()
if s[0] == s[1] == s[2]:
    print('No')
else:
    print('Yes')
Buggy python submission (verdict: Runtime Error):
a11,a12,a13 = input().split()
a21,a22,a23 = input().split()
a31,a32,a33 = input().split()

n = int(input())
b = list()
i = 0

for i in range(n):
    b.append(int(input()))

if a11 in b:
    a11 = 'T'

if a12 in b:
    a12 = 'T'

if a13 in b:
    a13 = 'T'

if a21 in b:
    a21 = 'T'

if a22 in b:
    a22 = 'T'

if a23 in b:
    a23 = 'T'

if a31 in b:
    a31 = 'T'

if a32 in b:
    a32 = 'T'

if a33 in b:
    a33 = 'T'

if a11 == 'T':
    if a12 == 'T':
        if a13 == 'T':
            print('Yes')
            exit()
    
    if a22 == 'T':
        if a33 == 'T':
            print('Yes')
            exit()
    
    if a21 == 'T':
        if a31 == 'T':
            print('Yes')
            exit()

elif a12 == 'T':
    if a22 == 'T':
        if a32 == 'T':
            print('Yes')
            exit()

elif a13 == 'T':
    if a22 == 'T':
        if a31 == 'T':
            print('Yes')
            exit()

     if a23 == 'T':
        if a33 == 'T':
            print('Yes')
            exit()

elif a21 == 'T':
    if a22 == 'T':
        if a23 == 'T':
            print('Yes')
            exit()

elif a31 == 'T':
    if a32 == 'T':
        if a33 == 'T':
            print('Yes')
            exit()

else:
    print('No')

Fixed submission:
x = list(map(int,input().split()))
y = list(map(int,input().split()))
z = list(map(int,input().split()))
n = int(input())
b = list(int(input()) for i in range(n))

for i in range(n):
    if b[i] in x:
        x[x.index(b[i])] = 'T'
    if b[i] in y:
        y[y.index(b[i])] = 'T'
    if b[i] in z:
        z[z.index(b[i])] = 'T'

if x[0] == 'T' and x[1] == 'T' and x[2] == 'T':
    print('Yes')
elif y[0] == 'T' and y[1] == 'T' and y[2] == 'T':
    print('Yes')
elif z[0] == 'T' and z[1] == 'T' and z[2] == 'T':
    print('Yes')
elif x[0] == 'T' and y[0] == 'T' and z[0] == 'T':
    print('Yes')
elif x[1] == 'T' and y[1] == 'T' and z[1] == 'T':
    print('Yes')
elif x[2] == 'T' and y[2] == 'T' and z[2] == 'T':
    print('Yes')
elif x[0] == 'T' and y[1] == 'T' and z[2] == 'T':
    print('Yes')
elif x[2] == 'T' and y[1] == 'T' and z[0] == 'T':
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
l = [list(map(int,input().split())) for i in range(m)]
s,c = [list(i) for i in zip(*l)]
z = ['a'] * n
for i in range(m):
    if z[s[i]-1] == 'a':
        z[s[i]-1] = str(c[i])
    elif z[s[i]-1] == str(c[i]):
        pass
    else:
        print('-1')
        exit(0)
if n == 1:
    if z[0] == 'a':
        print(0)
    else:
        print(z[0])
else:
    if z[0] == '0':
        print(-1)
    else:
        if z[0] == 'a':
            z[0] = '1'
        for i in range(1,n):
            if z[i] == 'a':
                z[i] = '0'
        print(''.join(z))

Fixed submission:
n,m = map(int,input().split())
if m != 0:
    l = [list(map(int,input().split())) for i in range(m)]
    s,c = [list(i) for i in zip(*l)]
z = ['a'] * n
for i in range(m):
    if z[s[i]-1] == 'a':
        z[s[i]-1] = str(c[i])
    elif z[s[i]-1] == str(c[i]):
        pass
    else:
        print('-1')
        exit(0)
if n == 1:
    if z[0] == 'a':
        print(0)
    else:
        print(z[0])
else:
    if z[0] == '0':
        print(-1)
    else:
        if z[0] == 'a':
            z[0] = '1'
        for i in range(1,n):
            if z[i] == 'a':
                z[i] = '0'
        print(''.join(z))
Buggy python submission (verdict: Runtime Error):
n = int(input())
x = list(map(int,input().split()))
j = max(x)
m = 0
y = True

for i in range(n):
    if x[0] != x[i]:
        y = False

if y:
    print(0)
    exit(0)

for p in range(j):
    c = 0
    z = 0
    for i in range(n):
        z = x[i] - p
        c = c + (z * z)
    
    if m == 0:
        m = c
    else:
        if m > c:
            m = c

print(m)

Fixed submission:
n,r = map(int,input().split())
if n >= 10:
    print(r)
else:
    k = 10 - n
    print(100 * k + r)
Buggy python submission (verdict: Runtime Error):
n = int(input())
x = list(map(int,input().split()))
j = max(x)
m = 0
y = True

for p in range(n):
    if x[0] != x[i]:
        y = False

if y:
    print(0)
    exit(0)

for p in range(j):
    c = 0
    z = 0
    for i in range(n):
        z = x[i] - p
        c = c + (z * z)
    
    if m == 0:
        m = c
    else:
        if m > c:
            m = c

print(m)

Fixed submission:
n = int(input())
x = list(map(int,input().split()))
j = max(x)
m = 0
y = True

for i in range(n):
    if x[0] != x[i]:
        y = False

if y:
    print(0)
    exit(0)

for p in range(j):
    c = 0
    z = 0
    for i in range(n):
        z = x[i] - p
        c = c + (z * z)
    
    if m == 0:
        m = c
    else:
        if m > c:
            m = c

print(m)

Buggy python submission (verdict: Runtime Error):
n = int(input())
x = list(map(int,input().split()))
j = max(x)
m = 0
y = True

for p in range(n):
    if x[0] != x[i]:
        y = False

if y:
    print(0)
    exit(0)

for p in range(j):
    c = 0
    z = 0
    for i in range(n):
        z = x[i] - p
        c = c + (z * z)
    
    if m == 0:
        m = c
    else:
        if m > c:
            m = c

print(m)

Fixed submission:
n = int(input())
x = list(map(int,input().split()))
j = max(x)
m = 0
y = True

for i in range(n):
    if x[0] != x[i]:
        y = False

if y:
    print(0)
    exit(0)

for p in range(j):
    c = 0
    z = 0
    for i in range(n):
        z = x[i] - p
        c = c + (z * z)
    
    if m == 0:
        m = c
    else:
        if m > c:
            m = c

print(m)

Buggy python submission (verdict: Runtime Error):
n = int(input())
x = list(map(int,input().split()))
j = max(x)
m = 0
y = True

for p in range(n):
    if x[0] != x[i]:
        y = False

if y:
    print(0)
    exit(0)

for p in range(j):
    c = 0
    z = 0
    for i in range(n):
        z = x[i] - p
        c = c + (z * z)
    
    if m == 0:
        m = c
    else:
        if m > c:
            m = c

print(m)

Fixed submission:
n = int(input())
x = list(map(int,input().split()))
j = max(x)
m = 0
y = True

for i in range(n):
    if x[0] != x[i]:
        y = False

if y:
    print(0)
    exit(0)

for p in range(j):
    c = 0
    z = 0
    for i in range(n):
        z = x[i] - p
        c = c + (z * z)
    
    if m == 0:
        m = c
    else:
        if m > c:
            m = c

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

n = int(input())
s = list(input() for i in range(n))
c = collections.Counter(s)
p = max(c.values())
t = []

for i in range(len(c)):
    if c.most_common()[i][1] == p:
        t.append(c.most_common()[i][0])
    else:
        break

t.sort()
for i in range(len(t)):
    print(t[i])

Fixed submission:
import collections

n = int(input())
s = list(input() for i in range(n))
s = sorted(s)
c = collections.Counter(s)
p = max(c.values())
s = sorted(list(set(s)))

for i in range(len(s)):
    if c[s[i]] == p:
        print(s[i])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = list(input() for i in range(n))
t = []
r = []

for i in range(n):
    if not s[i] in t:
        t.append(s[i])
        r.append(1)
    else:
        j = t.index(s[i])
        r[j] += 1

m = max(r)
z = []

for i in range(len(t)):
    if r[i] == m:
        z.append(t[i])

z.sort()

for i in range(len(z)):
    print(z[i])

Fixed submission:
import collections

n = int(input())
s = list(input() for i in range(n))
s = sorted(s)
c = collections.Counter(s)
p = max(c.values())
s = sorted(list(set(s)))

for i in range(len(s)):
    if c[s[i]] == p:
        print(s[i])

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

n = int(input())
s = list(input() for i in range(n))
c = collections.Counter(s)
m = c.most_common()[0][1]

t = []
for i in range(len(c)):
    if c.most_common()[i][1] == m:
        t.append(c.most_common()[i][0])
    else:
        break

t.sort()
for i in range(len(t)):
    print(t[i])

Fixed submission:
import collections

n = int(input())
s = list(input() for i in range(n))
s = sorted(s)
c = collections.Counter(s)
p = max(c.values())
s = sorted(list(set(s)))

for i in range(len(s)):
    if c[s[i]] == p:
        print(s[i])
Buggy python submission (verdict: Runtime Error):
s,t = input().split()
a,b = map(int,input().split())
u = input()

if s == u:
    a = a - 1
else:
    b = b - 1

print(a + ' ' + b)

Fixed submission:
s,t = input().split()
a,b = map(int,input().split())
u = input()

if s == u:
    a = a - 1
else:
    b = b - 1

print(str(a) + ' ' + str(b))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
y = True

for p in range(n):
    i = p + 1
    while i < n:
        if a[p] == a[i]:
            y = False
            break
        i += 1
        
if y:
    print('YES')
else:
    print('NO')

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
list.sort(a)
y = True

for i in range(n - 1):
    if a[i] == a[i + 1]:
        y = False
        break
        
if y:
    print('YES')
else:
    print('NO')

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
y = True

for p in range(n):
    for i in range(n):
        if p == i:
            pass
        elif a[p] == a[i]:
            y = False
        else:
            pass
        
if y:
    print('YES')
else:
    print('NO')

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
list.sort(a)
y = True

for i in range(n - 1):
    if a[i] == a[i + 1]:
        y = False
        break
        
if y:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
p = list(map(int,input().split()))
t = 0
for i in range(n-k+1):
    t = max(t,(k+sum(p[i:i+k]))/2)
print(t)

Fixed submission:
n,k = map(int,input().split())
p = list(map(int,input().split()))
p.append(0)
s = sum(p[:k])
t = 0
for i in range(k-1,n):
    t = max(t,(k+s)/2)
    s -= p[i-k+1]
    s += p[i+1]
print(t)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int,input().split()))
m = n
q = []

for i in range(n):
    q.append(p[i])
    if not p[i] <= min(q):
        m -= 1

print(m)

Fixed submission:
n = int(input())
p = list(map(int,input().split()))
m = n
q = 2 * (10 ** 5)

for i in range(n):
    q = min(p[i],q)
    if not p[i] <= q:
        m -= 1

print(m)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int,input().split()))
m = n

for i in range(n):
    q = p[0:i+1]
    if not p[i] <= min(q):
        m -= 1

print(m)

Fixed submission:
n = int(input())
p = list(map(int,input().split()))
m = n
q = 2 * (10 ** 5)

for i in range(n):
    q = min(p[i],q)
    if not p[i] <= q:
        m -= 1

print(m)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int,input().split()))
m = n

for i in range(n):
    for j in range(i + 1):
        if not p[i] <= p[j]:
            m -= 1
            break

print(m)

Fixed submission:
n = int(input())
p = list(map(int,input().split()))
m = n
q = 2 * (10 ** 5)

for i in range(n):
    q = min(p[i],q)
    if not p[i] <= q:
        m -= 1

print(m)
Buggy python submission (verdict: Runtime Error):
h = int(input())
w = int(input())
n = int(input())

if h < w:
    if n % w == 0:
        print(n % w)
    else:
        print(n % w + 1)
if n % h == 0:
        print(n % h)
    else:
        print(n % h + 1)

Fixed submission:
h = int(input())
w = int(input())
n = int(input())

if h < w:
    if n % w == 0:
        print(n // w)
    else:
        print(n // w + 1)
else:
    if n % h == 0: 
        print(n // h)
    else:
        print(n // h + 1)
Buggy python submission (verdict: Runtime Error):
N,K,M = map(int,input().split())
A = list(map(int,input().split()))

L = N * M
S = sum(A)

if L - S > K or S >= L:
    print(-1)
else:
    print(L - S)

Fixed submission:
c = input()
c = ord(c) + 1
print(chr(c))

Buggy python submission (verdict: Runtime Error):
c = input()
c = ord(c + 1)
print(c)

Fixed submission:
c = input()
c = ord(c) + 1
print(chr(c))

Buggy python submission (verdict: Runtime Error):
c = input()
c = c + 1
print(c)

Fixed submission:
c = input()
c = ord(c) + 1
print(chr(c))
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
l = [list(input().split()) for i in range(m)]
p,s = [list(i) for i in zip(*l)]
t = []
x = 0
y = 0

for i in range(m):
    if not p[i] in t:
        if s[i] == 'WA':
            y += 1
        else:
            t.append(p[i])
            x += 1

print(x,y)

Fixed submission:
n,m = map(int,input().split())
if m != 0:
    l = [list(input().split()) for i in range(m)]
    p,s = [list(i) for i in zip(*l)]
t = [0] * n
ac = 0
wa = 0

for i in range(m):
    if s[i] == 'WA' and t[int(p[i])-1] != 'AC':
        t[int(p[i])-1] += 1
    elif s[i] == 'AC' and t[int(p[i])-1] != 'AC':
        ac += 1
        wa += t[int(p[i])-1]
        t[int(p[i])-1] = 'AC'

print(ac,wa)
Buggy python submission (verdict: Runtime Error):
s = input()
n = len(s) // 2
p = n
j = -1

for i in range(n):
    if n[i] == n[j]:
        p -= 1
    j -= 1

print(p)

Fixed submission:
s = input()
n = len(s) // 2
p = n
j = -1

for i in range(n):
    if s[i] == s[j]:
        p -= 1
    j -= 1

print(p)
Buggy python submission (verdict: Runtime Error):
m1,d1 = map(int,input().split())
m2,d2 = map(int,input().split())

if mi == m2:
    print(0)
else:
    print(1)

Fixed submission:
m1,d1 = map(int,input().split())
m2,d2 = map(int,input().split())

if m1 == m2:
    print(0)
else:
    print(1)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = list(input())
t = []
ans = 0
for i in range(1000):
    t.append(str(i//100))
    t.append(str(i//10%10))
    t.append(str(i%10))
    flg = 0
    for j in range(n):
        if t[flg] == s[j]:
            flg += 1
            if flg == 3:
                ans += 1
                break
    t.clear()
print(ans)

Fixed submission:
n = int(input())
s = list(input())
t = []
ans = 0
for i in range(1000):
    t.append(str(i//100))
    t.append(str(i//10%10))
    t.append(str(i%10))
    k = 0
    p = 0
    for j in range(3):
        if t[j] in s[k:]:
            p = s[k:].index(t[j]) + 1
            k += p
        else:
            p = -1
            break
    if p != -1:
        ans += 1
    t.clear()
print(ans)
Buggy python submission (verdict: Runtime Error):
import itertools
import math
n = int(input())
m = math.factorial(n)
l = [list(map(int,input().split())) for i in range(n)]
x,y = [list(i) for i in zip(*l)]
z = list(range(n))
z = list(itertools.permutations(l))
ans = 0
for i in range(m):
    for j in range(n-1):
        ans += math.sqrt((x[z[i][j]] - x[z[i][j+1]]) ** 2 + (y[z[i][j]] - y[z[i][j+1]]) ** 2)
print(ans / m)

Fixed submission:
import itertools
import math
n = int(input())                    #n = 町の個数
l = [list(map(int,input().split())) for i in range(n)]
x,y = [list(i) for i in zip(*l)]    #x,y = 町の座標
l = list(range(n))                  
z = list(itertools.permutations(l)) #z = 経路の組み合わせ
m = math.factorial(n)               #m = 経路の個数
t = 0                               #t = 長さの合計

for i in range(m):
    for j in range(n - 1):
        t += math.sqrt((x[z[i][j]] - x[z[i][j+1]]) ** 2 + (y[z[i][j]] - y[z[i][j+1]]) ** 2)

print(t / m)
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
h = list(map(int,inpu().split()))
c = 0

for i in range(n):
    if h[i] >= k:
        c += 1

print(c)

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

for i in range(n):
    if h[i] >= k:
        c += 1

print(c)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = list(map(int,input().split()))
p = []

for i in range(n):
    j = s.index(i + 1) + 1
    p.append(str(j))

print(' '.join(p))

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
t = ['0'] * n

for i in range(n):
    t[a[i] - 1] = str(i + 1)

print(' '.join(t))
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
l = [[] for i in range(n+1)]
l[0] = ['0',0]
ans = 0
for i in range(1,n+1):
    l[i] = [s[i-1:],i]
l.sort()
for i in range(n):
    for j in range(i+1,n):
        m = min(len(l[i][0]),len(l[j][0]))
        x = l[i][0]
        y = l[j][0]
        z = 0
        while z < m:
            if x[z] != y[z]:
                break
            z += 1
        if z > l[i][1] - l[j][1]:
            z = l[i][1] - l[j][1]
        ans = max(z,ans)
print(ans)

Fixed submission:
s = input()
a ='Sunny'
b ='Cloudy'
c ='Rainy'
if s == a:
    print(b)
elif s == b:
    print(c)
else:
    print(a)
Buggy python submission (verdict: Time Limit Exceeded):
N,K,Q = map(int,input().split())
A = []
L = []
for i in range(N):
    A.append(K - Q)
for i in range(Q):
    L.append(int(input()))
for i in range(Q):
    for j in range(N):
        if j == L[i] - 1:
            A[j] += 1

for i in range(N):
    if A[i] <= 0:
        print('No')
    else:
        print('Yes')

Fixed submission:
N,K,Q = map(int,input().split())
A = []
L = []
for i in range(N):
    A.append(K - Q)
for i in range(Q):
    L.append(int(input()))
for i in range(Q):
    j = L[i]
    A[j - 1] += 1

for i in range(N):
    if A[i] <= 0:
        print('No')
    else:
        print('Yes')

Buggy python submission (verdict: Time Limit Exceeded):
N,K,Q = map(int,input().split())
A = []
L = []
for i in range(N):
    A.append(K)
for i in range(Q):
    L.append(int(input()))
for i in range(Q):
    for j in range(N):
        if j == L[i] - 1:
            pass
        else:
            A[j] -= 1

for i in range(N):
    if A[i] <= 0:
        print('No')
    else:
        print('Yes')

Fixed submission:
N,K,Q = map(int,input().split())
A = []
L = []
for i in range(N):
    A.append(K - Q)
for i in range(Q):
    L.append(int(input()))
for i in range(Q):
    j = L[i]
    A[j - 1] += 1

for i in range(N):
    if A[i] <= 0:
        print('No')
    else:
        print('Yes')
Buggy python submission (verdict: Runtime Error):
n = int(input())
b = list(map(int,input().split()))
a = [b[0]]

for i in range(n - 1):
    a.append(min(b[i],b[i+1]))

a.append(b[-1])
print(sum(a))

Fixed submission:
n = int(input())
b = list(map(int,input().split()))
a = [b[0]]

for i in range(n-2):
    a.append(min(b[i],b[i+1]))

a.append(b[-1])
print(sum(a))

Buggy python submission (verdict: Runtime Error):
n = int(input())
b = list(map(int,input().split()))
a = [b[0]]

for i in range(n - 1)
    a.append(min(b[i],b[i+1]))

a.append(b[-1])
print(sum(a))

Fixed submission:
n = int(input())
b = list(map(int,input().split()))
a = [b[0]]

for i in range(n-2):
    a.append(min(b[i],b[i+1]))

a.append(b[-1])
print(sum(a))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
a.sort()
z = a[0]
t = 1

while t != 0:
    t = 0
    for i in range(1,n):
        if z % a[i] != 0:
            t = 1
    if t == 1:
        z += a[0]

y = 0
for i in range(n):
    y += z // a[i]

print(z / y)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
t = 0

for i in range(n):
    t += 1 / a[i]

print(1 / t)
Buggy python submission (verdict: Runtime Error):
s = input()
t = s[0]
p = 1
i = 1
while i < len(s):
    if s[i] == t:
        i += 2
    else:
        i += 1
    t = s[i-1]
    p += 1

print(p)

Fixed submission:
s = list(input())
i = len(s)
p = 0
while i >= 3:
    if s[i-1] == s[i-2]:
        i -= 3
        p += 2
    else:
        i -= 1
        p += 1

if i <= 1:
    print(p+i)
else:
    if s[i-1] == s[i-2]:
        print(p+1)
    else:
        print(p+2)
Buggy python submission (verdict: Runtime Error):
k,x = map(int,input().split())
a = x-k+1
b = x+k
c = list(range(a,b))
str(c)
print(' '.join(c))

Fixed submission:
k,x = map(int,input().split())
t = []
for i in range(x-k+1,x+k):
    t.append(str(i))
print(' '.join(t))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = []
ans = 0
for i in range(n):
    a.append(sorted(input()))
for i in range(n-1):
    for j in range(i+1,n):
        if a[i] == a[j]:
            ans += 1
print(ans)

Fixed submission:
n = int(input())
a = []
ans = 0
for i in range(n):
    a.append(sorted(input()))
a.sort()
flg = 0
for i in range(1,n):
    if a[flg] != a[i]:
        z = i - 1 - flg
        ans += (1 + z) * z // 2
        flg = i
z = n - 1 - flg
ans += (1 + z) * z // 2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = list(sorted(input()) for i in range(n))
p = 0
for i in range(n-1):
    for j in range(i+1,n):
        if s[i] == s[j]:
            p += 1

print(p)

Fixed submission:
n = int(input())
a = []
ans = 0
for i in range(n):
    a.append(sorted(input()))
a.sort()
flg = 0
for i in range(1,n):
    if a[flg] != a[i]:
        z = i - 1 - flg
        ans += (1 + z) * z // 2
        flg = i
z = n - 1 - flg
ans += (1 + z) * z // 2
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(int(input()) for i in range(n))
for i in range(n):
    b = list(a)
    b.pop(i)
    print(max(b))

Fixed submission:
n = int(input())
a = list(int(input()) for i in range(n))
b = list(a)
b.sort(reverse = True)
c = b[0]
for i in range(n):
    if a[i] == c:
        print(b[1])
    else:
        print(c)
Buggy python submission (verdict: Runtime Error):
s = input()
l = set(s)
if len(l) == 2 and l.count(s[0]) == 2:
    print('Yes')
else:
    print('No')

Fixed submission:
s = input()
l = set(s)
if len(l) == 2 and s.count(s[0]) == 2:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
n = int(input())
p = list(map(int,input().split()))
c = 0

for i in range(1,n - 1):
    if p[n - 1] < p[n] and p[n] < p[n + 1]:
        c = c + 1

print(c)

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

for i in range(1,n-1):
    if p[i-1] < p[i] and p[i] < p[i+1]:
        c = c + 1

    if p[i-1] > p[i] and p[i] > p[i+1]:
        c = c + 1

print(c)
Buggy python submission (verdict: Runtime Error):
s = int(input())
if s[0] == s[1] or s[1] == s[2] or s[2] == s[3]:
    print('Bad')
else:
    print('Good')

Fixed submission:
s = input()
if s[0] == s[1] or s[1] == s[2] or s[2] == s[3]:
    print('Bad')
else:
    print('Good')