Buggy python submission (verdict: Runtime Error):
s = list(input())
int pattern_a_count = 0
int pattern_b_count = 0

for index, value in enumerate(s):
  if index % 2 =0:
    if value == 0:
      pattern_a_count += 1
  if index % 2 =1:
    if value == 1:
      pattern_a_count += 1
      
for index, value in enumerate(s):
  if index % 2 =0:
    if value == 1:
      pattern_b_count += 1
  if index % 2 =1:
    if value == 0:
      pattern_b_count += 1
      
res = pattern_b_count
if pattern_a_count <= pattern_b_count:
  res = pattern_a_count
print(pattern_a_count)

Fixed submission:
s = list(input())
pattern_a_count = 0
pattern_b_count = 0

# 1010パターン
for index, value in enumerate(s):
  if index % 2 == 0:
    if value == "0":
      pattern_a_count += 1
  if index % 2 == 1:
    if value == "1":
      pattern_a_count += 1

# 0101
for index, value in enumerate(s):
  if index % 2 == 0:
    if value == "1":
      pattern_b_count += 1
  if index % 2 == 1:
    if value == "0":
      pattern_b_count += 1
      
res = pattern_b_count
if pattern_a_count <= pattern_b_count:
  res = pattern_a_count
print(res)

Buggy python submission (verdict: Runtime Error):
s = list(input())
int pattern_a_count = 0
int pattern_b_count = 0

for index, value in enumerate(s):
  if index % 2 =0:
    if value == "0":
      pattern_a_count += 1
  if index % 2 =1:
    if value == "1":
      pattern_a_count += 1
      
for index, value in enumerate(s):
  if index % 2 =0:
    if value == "1":
      pattern_b_count += 1
  if index % 2 =1:
    if value == "0":
      pattern_b_count += 1
      
res = pattern_b_count
if pattern_a_count <= pattern_b_count:
  res = pattern_a_count
print(pattern_a_count)

Fixed submission:
s = list(input())
pattern_a_count = 0
pattern_b_count = 0

# 1010パターン
for index, value in enumerate(s):
  if index % 2 == 0:
    if value == "0":
      pattern_a_count += 1
  if index % 2 == 1:
    if value == "1":
      pattern_a_count += 1

# 0101
for index, value in enumerate(s):
  if index % 2 == 0:
    if value == "1":
      pattern_b_count += 1
  if index % 2 == 1:
    if value == "0":
      pattern_b_count += 1
      
res = pattern_b_count
if pattern_a_count <= pattern_b_count:
  res = pattern_a_count
print(res)

Buggy python submission (verdict: Runtime Error):
s = list(input())
int pattern_a_count = 0
int pattern_b_count = 0

for index, value in enumerate(s):
  if index % 2 =0:
    if value == "0":
      pattern_a_count += 1
  if index % 2 =1:
    if value == "1":
      pattern_a_count += 1
      
for index, value in enumerate(s):
  if index % 2 =0:
    if value == "1":
      pattern_b_count += 1
  if index % 2 =1:
    if value == "0":
      pattern_b_count += 1

Fixed submission:
s = list(input())
pattern_a_count = 0
pattern_b_count = 0

# 1010パターン
for index, value in enumerate(s):
  if index % 2 == 0:
    if value == "0":
      pattern_a_count += 1
  if index % 2 == 1:
    if value == "1":
      pattern_a_count += 1

# 0101
for index, value in enumerate(s):
  if index % 2 == 0:
    if value == "1":
      pattern_b_count += 1
  if index % 2 == 1:
    if value == "0":
      pattern_b_count += 1
      
res = pattern_b_count
if pattern_a_count <= pattern_b_count:
  res = pattern_a_count
print(res)