Buggy python submission (verdict: Runtime Error):
S = input()
s = list(map(int, S))
t = s.copy()
x = 0
y = 1

if t[0] == 0:
    t[0]=1
else:
    t[0]=0

for i in s:
    if s[i]==0 and s[i+1] == s[i]:
    	s[i+1]=1
    	x +=1
    elif s[i]==1 and s[i+1]==s[i]:
    	s[i+1]=0
    	x +=1

for i in t:
    if t[i]==0 and t[i+1] == t[i]:
    	t[i+1]=1
    	y +=1
    elif t[i]==1 and t[i+1]==t[i]:
    	t[i+1]=0
    	y +=1

print(min([x,y]))

Fixed submission:
S = input()
s = list(map(int, S))
t = s.copy()
n = len(s)
x = 0
y = 1

if t[0] == 0:
    t[0]=1
else:
    t[0]=0

for i in range(n-1):
    if s[i+1]==0 and s[i+1] == s[i]:
    	s[i+1]=1
    	x +=1
    elif s[i+1]==1 and s[i+1]==s[i]:
    	s[i+1]=0
    	x +=1
    
for i in range(n-1):
    if t[i+1]==0 and t[i+1] == t[i]:
    	t[i+1]=1
    	y +=1
    elif t[i+1]==1 and t[i+1]==t[i]:
    	t[i+1]=0
    	y +=1

print(min([x,y]))

Buggy python submission (verdict: Runtime Error):
S = input()
s = list(map(int, S))
t = s.copy()
x = 0
y = 1

if t[0] == 0:
    t[0]=1
else:
    t[0]=0

for i in s:
    if s[i+1]==0 and s[i+1] == s[i]:
    	s[i+1]=1
    	x +=1
    elif s[i+1]==1 and s[i+1]==s[i]:
    	s[i+1]=0
    	x +=1

for i in t:
    if t[i+1]==0 and t[i+1] == t[i]:
    	t[i+1]=1
    	y +=1
    elif t[i+1]==1 and t[i+1]==t[i]:
    	t[i+1]=0
    	y +=1

print(min([x,y]))


Fixed submission:
S = input()
s = list(map(int, S))
t = s.copy()
n = len(s)
x = 0
y = 1

if t[0] == 0:
    t[0]=1
else:
    t[0]=0

for i in range(n-1):
    if s[i+1]==0 and s[i+1] == s[i]:
    	s[i+1]=1
    	x +=1
    elif s[i+1]==1 and s[i+1]==s[i]:
    	s[i+1]=0
    	x +=1
    
for i in range(n-1):
    if t[i+1]==0 and t[i+1] == t[i]:
    	t[i+1]=1
    	y +=1
    elif t[i+1]==1 and t[i+1]==t[i]:
    	t[i+1]=0
    	y +=1

print(min([x,y]))

Buggy python submission (verdict: Runtime Error):
S = input()
s = list(map(int, S)
t = s.copy()
x = 0
y = 1

if t[0] == 0:
    t[0]=1
else:
    t[0]=0

for i in s:
    if s[i+1]==0 and s[i+1] == s[i]:
    	s[i+1]=1
    	x +=1
    elif s[i+1]==1 and s[i+1]==s[i]:
    	s[i+1]=0
    	x +=1

for i in t:
    if t[i+1]==0 and t[i+1] == t[i]:
    	t[i+1]=1
    	y +=1
    elif t[i+1]==1 and t[i+1]==t[i]:
    	t[i+1]=0
    	y +=1

print(min([x,y]))


Fixed submission:
S = input()
s = list(map(int, S))
t = s.copy()
n = len(s)
x = 0
y = 1

if t[0] == 0:
    t[0]=1
else:
    t[0]=0

for i in range(n-1):
    if s[i+1]==0 and s[i+1] == s[i]:
    	s[i+1]=1
    	x +=1
    elif s[i+1]==1 and s[i+1]==s[i]:
    	s[i+1]=0
    	x +=1
    
for i in range(n-1):
    if t[i+1]==0 and t[i+1] == t[i]:
    	t[i+1]=1
    	y +=1
    elif t[i+1]==1 and t[i+1]==t[i]:
    	t[i+1]=0
    	y +=1

print(min([x,y]))

Buggy python submission (verdict: Runtime Error):
s = list(map(int, input().split()))
t = s.copy()
x = 0
y = 1

if t[0] == 0:
    t[0]=1
else:
    t[0]=0

for i in s:
    if s[i+1]==0 and s[i+1] == s[i]:
    	s[i+1]=1
    	x +=1
    elif s[i+1]==1 and s[i+1]==s[i]:
    	s[i+1]=0
    	x +=1

Fixed submission:
S = input()
s = list(map(int, S))
t = s.copy()
n = len(s)
x = 0
y = 1

if t[0] == 0:
    t[0]=1
else:
    t[0]=0

for i in range(n-1):
    if s[i+1]==0 and s[i+1] == s[i]:
    	s[i+1]=1
    	x +=1
    elif s[i+1]==1 and s[i+1]==s[i]:
    	s[i+1]=0
    	x +=1
    
for i in range(n-1):
    if t[i+1]==0 and t[i+1] == t[i]:
    	t[i+1]=1
    	y +=1
    elif t[i+1]==1 and t[i+1]==t[i]:
    	t[i+1]=0
    	y +=1

print(min([x,y]))

Buggy python submission (verdict: Runtime Error):
s = list(map(int, input().split()))
t = s.copy()
x = 0
y = 1

if t[0] == 0:
    t[0]=1
else:
    t[0]=0

for i in s:
    if s[i+1]==0 and s[i+1] == s[i]:
    	s[i+1]=1
    	x +=1
    elif s[i+1]==1 and s[i+1]==s[i]:
    	s[i+1]=0
    	x +=1

for i in t:
    if t[i+1]==0 and t[i+1] == t[i]:
    	t[i+1]=1
    	y +=1
    elif t[i+1]==1 and t[i+1]==t[i]:
    	t[i+1]=0
    	y +=1

print(min([x,y]))


Fixed submission:
S = input()
s = list(map(int, S))
t = s.copy()
n = len(s)
x = 0
y = 1

if t[0] == 0:
    t[0]=1
else:
    t[0]=0

for i in range(n-1):
    if s[i+1]==0 and s[i+1] == s[i]:
    	s[i+1]=1
    	x +=1
    elif s[i+1]==1 and s[i+1]==s[i]:
    	s[i+1]=0
    	x +=1
    
for i in range(n-1):
    if t[i+1]==0 and t[i+1] == t[i]:
    	t[i+1]=1
    	y +=1
    elif t[i+1]==1 and t[i+1]==t[i]:
    	t[i+1]=0
    	y +=1

print(min([x,y]))

Buggy python submission (verdict: Runtime Error):
s = list(map(int, input().split()))
t = s.copy()
cnta = 0
cntc = 0
ans = [cnta, cntc]
if t[0] == 0:
    t[0]=1
else:
    t[0]=0

for i in s:
    if s[i+1]==0 and s[i+1] == s[i]:
    	s[i+1]=1
    	cnta +=1
    elif s[i+1]==1 and s[i+1]==s[i]:
    	s[i+1]=0
    	cnta +=1

for i in t:
    if t[i+1]==0 and t[i+1] == t[i]:
    	t[i+1]=1
    	cntc +=1
    elif t[i+1]==1 and t[i+1]==t[i]:
    	t[i+1]=0
    	cntc +=1

print(min(ans))

Fixed submission:
S = input()
s = list(map(int, S))
t = s.copy()
n = len(s)
x = 0
y = 1

if t[0] == 0:
    t[0]=1
else:
    t[0]=0

for i in range(n-1):
    if s[i+1]==0 and s[i+1] == s[i]:
    	s[i+1]=1
    	x +=1
    elif s[i+1]==1 and s[i+1]==s[i]:
    	s[i+1]=0
    	x +=1
    
for i in range(n-1):
    if t[i+1]==0 and t[i+1] == t[i]:
    	t[i+1]=1
    	y +=1
    elif t[i+1]==1 and t[i+1]==t[i]:
    	t[i+1]=0
    	y +=1

print(min([x,y]))