Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
A, B, C  =  map(int, input().sprt))

Fixed submission:
a,b,c=map(int,input().split())
if a>b:
    a,b=b,a
print("Yes" if a<=c<=b else "No")

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = list(input())

count_list =[]
wc = 0

A=[0]*(N)
bc = 0

for i in list(range(N))[::-1]:
    if(S[i] == '#'):
        bc  += 1
    A[i] = bc

for n in range(N-1):
    if(S[n] == '.'):
        num = n
        count_list.append(A[n+1] + wc)
        wc += 1

if(S[N-1] == '.'):
    count_list.append(wc+1)

count = min(count_list)
print(count)

Fixed submission:
h1, h2, d = list(map(int, (input().split())))

if(h1 > h2):
    temp = h2
    h2 = h1
    h1 = temp

if(d >= h1 and d <= h2):
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = list(input())

count_list =[]
wc = 0

A=[0]*(N)

for i in list(range(N-1))[::-1]:
    if(S[i] == '#'):
        A[i] = A[i+1] + 1

for n in range(N-1):
    if(S[n] == '.'):
        num = n
        count_list.append(A[n+1] + wc)
        wc += 1

if(S[N-1] == '.'):
    count_list.append(wc+1)

count = min(count_list)
print(count)

Fixed submission:
h1, h2, d = list(map(int, (input().split())))

if(h1 > h2):
    temp = h2
    h2 = h1
    h1 = temp

if(d >= h1 and d <= h2):
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = list(input())

count_list =[]
wc = 0

A=[0]*(N+1)

for i in list(range(N))[::-1]:
    if(S[i] == '#'):
        A[i] = A[i+1] + 1

print(A)
for n in range(N-1):
    if(S[n] == '.'):
        num = n
        count_list.append(A[n+1] + wc)
        wc += 1

if(S[N-1] == '.'):
    count_list.append(wc+1)

count = min(count_list)
print(count)

Fixed submission:
h1, h2, d = list(map(int, (input().split())))

if(h1 > h2):
    temp = h2
    h2 = h1
    h1 = temp

if(d >= h1 and d <= h2):
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
  A, B, C = map(int, input().split())
   
  if(A<C and C<B) or (B<C and C<A):
      print('Yes')
  else:
      print('No')   

Fixed submission:
A, B, C = map(int, input().split())

if(A<C and C<B) or (B<C and C<A):
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
v1, v2 = map(int, input().split())

if v1 < v2:
    t = v1
    v1 = v2
    v2 = t

v3 = v1 - v2

if v3 = 0:
    print(v1*2)

if v3 <= 2:
    print(v1*2-1)

if v1 == 1:
    print(v1*2+1)

Fixed submission:
A, B = map(int, input().split())
print(max([A + A - 1, B + A, B + B -1]))
Buggy python submission (verdict: Runtime Error):
N=int(input())
S=input()
K=int(input())
tmp=S[K-1]
out=[]
for i in range(N):
    if S[i]!=tmp:
        out.append("*")
    else:
        out.append(S[i])
ttt=""
for i in out:
    ttt="{}{}".format(ttt,i)
print(ttt)
N=input()
N=int(input())

Fixed submission:
N=int(input())
S=input()
K=int(input())
tmp=S[K-1]
out=[]
for i in range(N):
    if S[i]!=tmp:
        out.append("*")
    else:
        out.append(S[i])
ttt=""
for i in out:
    ttt="{}{}".format(ttt,i)
print(ttt)

Buggy python submission (verdict: Runtime Error):
N=input()
S=input()
K=input()
tmp=S[K-1]
out=[]
for i in range(N):
    if S[i]!=tmp:
        out.append("*")
    else:
        out.append(S[i])
ttt=""
for i in out:
    ttt="{}{}".format(ttt,i)
print(ttt)


Fixed submission:
N=int(input())
S=input()
K=int(input())
tmp=S[K-1]
out=[]
for i in range(N):
    if S[i]!=tmp:
        out.append("*")
    else:
        out.append(S[i])
ttt=""
for i in out:
    ttt="{}{}".format(ttt,i)
print(ttt)

Buggy python submission (verdict: Runtime Error):
N=input()
S=input()
K=input()
tmp=S[K-1]
out=[]
for i in range(N):
    if S[i]!=tmp:
        out.append("*")
    else:
        out.append(S[i])
ttt=""
for i in out:
    ttt="{}{}".format(ttt,i)
print(ttt)


Fixed submission:
N=int(input())
S=input()
K=int(input())
tmp=S[K-1]
out=[]
for i in range(N):
    if S[i]!=tmp:
        out.append("*")
    else:
        out.append(S[i])
ttt=""
for i in out:
    ttt="{}{}".format(ttt,i)
print(ttt)

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = str(input())
k = int(input())
for i in range(n):
    if s[i] != s[k]:
        s = s.replace(s[i],"*")
print(s)

Fixed submission:
n = int(input())
s = str(input())
k = int(input())
for i in range(n):
    if s[i] != s[k-1]:
        s = s.replace(s[i],"*")
print(s)
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3

a,b,c = map(int,input().spliy())

if a < c and c < b:
    print("Yes")

elif b < c and c < a:
    print("Yes")

else:
    print("No")

Fixed submission:
#!/usr/bin/env python3

a,b,c = map(int,input().split())

if a < c and c < b:
    print("Yes")

elif b < c and c < a:
    print("Yes")

else:
    print("No")

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


def func(input_s):
    count = input_s.count(".")
    for c, i in enumerate(s):
        if c == "." and i != 0 and input_s[i - 1] == "#":
            tmp_str = input_s
            tmp_str[i - 1] = "."
            tmp_count = func(tmp_str[i:])
            count = min(tmp_count + 1, count)
    return count


pre = ""
print(func(s))


Fixed submission:
a, b, c = (int(i) for i in input().split())  
if a <= c <= b or b <= c <= a:
    print("Yes")
else:
    print("No")

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

char = s[k-1]
result = ""
for x in s:
    if x == char:
        result += char
    else:
        result += "*"
print(result)


Fixed submission:
a, b, c = (int(i) for i in input().split())  
if a <= c <= b or b <= c <= a:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
a = input()
b = input()
c = input()

if a <= c <= b or b <= c <= a:
    print("Yes")
else:
    print("No")

Fixed submission:
a, b, c = (int(i) for i in input().split())  
if a <= c <= b or b <= c <= a:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = str(input())
k = int(input())

char = s[k]
result = ""
for x in s:
    if x == char:
        result += char
    else:
        result += "*"
print(result)


Fixed submission:
n = int(input())
s = str(input())
k = int(input())
 
char = s[k-1]
result = ""
for x in s:
    if x == char:
        result += char
    else:
        result += "*"
print(result)

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

char = s[k]
result = ""
for x in s:
    if x == char:
        result += char
    else:
        result += "*"
print(result)


Fixed submission:
n = int(input())
s = str(input())
k = int(input())
 
char = s[k-1]
result = ""
for x in s:
    if x == char:
        result += char
    else:
        result += "*"
print(result)

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

char = s[k]
result = ""
for x in s:
    if x == char:
        result += char
    else:
        result += "*"
print(result)

Fixed submission:
n = int(input())
s = str(input())
k = int(input())
 
char = s[k-1]
result = ""
for x in s:
    if x == char:
        result += char
    else:
        result += "*"
print(result)
Buggy python submission (verdict: Runtime Error):
s = input()
if abs(c-a) > abs(b-a):
    print("Yes")
else:
    print("No")


Fixed submission:
s = input()
a, b, c = [int(_) for _ in s.split()]
a, b, c = [_-a for _ in (a, b, c)]

if b * c > 0 and abs(b) > abs(c):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
N = input()
S = input()
K = int(input())

tar = S[K-1]

lis = (_ if _==tar else "*" for _ in S]
print("".join(lis))

Fixed submission:
N = input()
S = input()
K = int(input())

tar = S[K-1]

lis = (_ if _==tar else "*" for _ in S)
print("".join(lis))
Buggy python submission (verdict: Runtime Error):
input_str = input()
homes = input_str.split(" ")
for home in homes:
    home = int(home)
print(homes)
if ((homes[2] - homes[1]) * (homes[2] - homes[0]) < 0):
    print("Yes")
else:
    print("No")


Fixed submission:
input_str = input()
homes = input_str.split(" ")
for i, home in enumerate(homes):
    homes[i] = int(home)
if ((homes[2] - homes[1]) * (homes[2] - homes[0]) < 0):
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
input_str = input()
homes = input_str.split(" ")
for home in homes:
    home = int(home)
print(homes)
if ((homes[3] - homes[1]) * (homes[3] - homes[2]) < 0):
    print("Yes")
else:
    print("No")


Fixed submission:
input_str = input()
homes = input_str.split(" ")
for i, home in enumerate(homes):
    homes[i] = int(home)
if ((homes[2] - homes[1]) * (homes[2] - homes[0]) < 0):
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
a,b,c = list(map(int,input().split()))

if b-c > 0 and c-a > 0:
    print("Yes")
else if a-b > 0 and b-c > 0:
    print("Yes")
else:
    print("No")

Fixed submission:
a,b,c = list(map(int,input().split()))

if b-c > 0 and c-a > 0:
    print("Yes")
elif a-c > 0 and c-b > 0:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
a,b,c = list(map(int,input().split()))

if b-c > 0 && c-a > 0:
    print("Yes")
else:
    print("No")

Fixed submission:
a,b,c = list(map(int,input().split()))

if b-c > 0 and c-a > 0:
    print("Yes")
elif a-c > 0 and c-b > 0:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = [i for i in input()]
for i in range(N):
    if(S[i]=='#'):
        break
s = S[i:]
if(i==0):
    print(0)
else:
    a = s.count('#')
    print(min(a,len(s)-a))

Fixed submission:
A,B,C = map(int,input().split())
if(A<C and C<B) or (B<C and C<A):
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
N = int(input())
a = [int(input()) for i in range(N)]

sum_ = sum(a)
count = 0
for j in range(2,N):
    for i in list(itertools.combinations(a,j)):
        if(2*sum(i)>sum_):
            for m in range(1,len(i)):
                for k in list(itertloos.combinations(i,m)):
                    if(sum_>2*sum(k) and sum_>2*(sum(i)-sum(k))):
                        count += 1
count = count * 6

Fixed submission:
A,B,C = map(int,input().split())
if(A<C and C<B) or (B<C and C<A):
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = [i for i in input()]
for i in range(N):
    if(S[i]=='#'):
        break
s = S[i:]
a = s.count('.')
print(min(a,len(s)-a))

Fixed submission:
A,B,C = map(int,input().split())
if(A<C and C<B) or (B<C and C<A):
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
import sys

def main(input):
    return input if len(input) == 2 else input[::-1]

if __name__ == "__main__":
    print main(sys.stdin.readline().strip())


Fixed submission:
#!/usr/bin/env python3

import sys


def main(input):
    return input if len(input) == 2 else input[::-1]

if __name__ == "__main__":
    print(main(sys.stdin.readline().strip()))

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3

import sys


def main(input):
    return input if len(input) == 2 else ''.join(reversed(input))

if __name__ == "__main__":
    print main(sys.stdin.readline().strip())


Fixed submission:
#!/usr/bin/env python3

import sys


def main(input):
    return input if len(input) == 2 else input[::-1]

if __name__ == "__main__":
    print(main(sys.stdin.readline().strip()))
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if c>a:
    if b>c:
        print("Yes")
        else:
            print("No")
else:
    print("No")

Fixed submission:
a,b,c=map(int,input().split())
if c>=a:
    if b>=c:
        print("Yes")
    else:
            print("No")
else:
    if b<=c:
        print("Yes")
    else:
            print("No")

Buggy python submission (verdict: Runtime Error):
n=2
string_list=[input() for i in range(n)]
c=0
new=''
a=0
b=0
f=0
for stone in string_list[1]:
    if stone=='.' and c==0:
        continue
    elif stone=='#':
        c+=1
        a+=1
        f+=1
    elif stone=='.':
        b+=1
        f=0

if b>=(a-f):
    print(a-f)
else:
    print(b)

Fixed submission:
li = list(map(int,input().split()))
if li[0]<li[2]<li[1] or li[1]<li[2]<li[0]:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
x=int(input())
li = list(map(int,input().split()))
i=0
c=0
a=0
for n in li:
  while c<i:
    if li[c]>n:
      break
    c+=1
    if c=i:
      a+=1
  c=0  
  i+=1
print(a)
    

Fixed submission:
x=int(input())
li = list(map(int,input().split()))
i=0
c=0
a=1
for n in li:
  while c<i:
    if li[c]>n:
      break
    c+=1
    if c==i:
      a+=1
  c=0  
  i+=1
print(a)
Buggy python submission (verdict: Runtime Error):
string=list(input())
if int(string[1])==0:
  c=1
else:
  c=0
a=0
for s in string:
  if int(s)==0 and c==1:
    c-=1
  elif int(s)==0 and c==0:
    c+=1
    a+=1
  elif int(s)==1 and c==0:
	c+=1
  elif int(s)==1 and c==1:
	c-=1
    a+=1
print(a)

Fixed submission:
string=list(input())
if int(string[0])==1:
    c=0
else:
    c=1
a=0
for s in string:
    if int(s)==0 and c==1:
        c-=1
    elif int(s)==0 and c==0:
        c+=1
        a+=1
    elif int(s)==1 and c==0:
        c+=1
    elif int(s)==1 and c==1:
        c-=1
        a+=1
print(a)

Buggy python submission (verdict: Runtime Error):
string=list(input())
if int(string[1]==0):
  c=1
else:
  c=0
a=0
for s in string:
  if int(s)==0 and c==1:
    c-=1
  elif int(s)==0 and c==0:
    c+=1
    a+=1
  elif int(s)==1 and c==0:
	c+=1
  elif int(s)==1 and c==1:
	c-=1
    a+=1
print(a)

Fixed submission:
string=list(input())
if int(string[0])==1:
    c=0
else:
    c=1
a=0
for s in string:
    if int(s)==0 and c==1:
        c-=1
    elif int(s)==0 and c==0:
        c+=1
        a+=1
    elif int(s)==1 and c==0:
        c+=1
    elif int(s)==1 and c==1:
        c-=1
        a+=1
print(a)

Buggy python submission (verdict: Runtime Error):
string=list(input())
c=0
a=0
for s in string:
  if int(s)==0 and c=1:
    c-=1
  elif int(s)==0 and c=0:
    c+=1
    a+=1
  elif int(s)==1 and c=0:
	c+=1
  elif int(s)==1 and c=1:
	c-=1
    a+=1
print(a)

Fixed submission:
string=list(input())
if int(string[0])==1:
    c=0
else:
    c=1
a=0
for s in string:
    if int(s)==0 and c==1:
        c-=1
    elif int(s)==0 and c==0:
        c+=1
        a+=1
    elif int(s)==1 and c==0:
        c+=1
    elif int(s)==1 and c==1:
        c-=1
        a+=1
print(a)
Buggy python submission (verdict: Runtime Error):
s=list(input())
s.sort()
j=0
if len(s) == 1:j=0
else: j=1
for i in s:
    if j == len(s)-1:print("yes")
        break
    if i == s[j]:print("no")
        break
    j+=1

Fixed submission:
l=list(input())
e=set(l)
if len(l)-len(e) == 0:
    print("yes")
else:
    print("no")
Buggy python submission (verdict: Runtime Error):
a=input(int())
b=input(int())
c=input(int())
if a>c>b or b>c>a:
    print("Yes")
else:print("No")

Fixed submission:
a,b,c=map(int, input().split())
if a>c>b or b>c>a:
    print("Yes")
else:print("No")

Buggy python submission (verdict: Runtime Error):
a=input(int())
b=input(int())
c=input(int())
if a>c>b or b>c>a:
    print("Yes")
else:print("No")

Fixed submission:
a,b,c=map(int, input().split())
if a>c>b or b>c>a:
    print("Yes")
else:print("No")

Buggy python submission (verdict: Runtime Error):
a=input(int())
b=input(int())
c=input(int())
if a>c or b>c:
    print("Yes")
else:print("No")

Fixed submission:
a,b,c=map(int, input().split())
if a>c>b or b>c>a:
    print("Yes")
else:print("No")

Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input())
if b>c:
    print("Yes")
else:print("No")


Fixed submission:
a,b,c=map(int, input().split())
if a>c>b or b>c>a:
    print("Yes")
else:print("No")
Buggy python submission (verdict: Runtime Error):
N =input(int())
i =input(int())
print(int(N+1-i))

Fixed submission:
N, i = map(int, input().split())
print(int(N-i+1))

Buggy python submission (verdict: Runtime Error):
N =input(int())
a =input(int())
print(N-a+1)

Fixed submission:
N, i = map(int, input().split())
print(int(N-i+1))
Buggy python submission (verdict: Runtime Error):
A=input(int())
B=input(int())
print(max(A+B,A-B,A*B))

Fixed submission:
A,B=map(int,input().split())
print(max(A+B,A-B,A*B))
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
 
ans = 0
 
while all(a % 2 == 0 for a in A):
    ans += 1
    for i in range(N):
        A[i] = int(A[i] / 2)
 
print(ans)

Fixed submission:
a,b,c=map(int,input())
print(a+b+c)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
c,d=map(int,input().split())
if b>c:
    print(b-c)
elese:print("0")

Fixed submission:
A, B, C, D = map(int, input().split())
print(max(0, min(B, D) - max(A, C)))
Buggy python submission (verdict: Runtime Error):
a = int(input())
mozi = input()
b = int(input())

test = mozi[b]

ans = ""

for i in mozi:
    if i == test:



Fixed submission:
s = [int(i) for i in input().split(" ")]
count = 0

if s[0] < s[1]:
    for i in range(s[0], s[1]):
        if i == s[2]:
            print("Yes")
            count = 1
            break

else:
    for i in range(s[1], s[0]):
        if i == s[2]:
            print("Yes")
            count = 1
            break

if count == 0:
    print("No")
Buggy python submission (verdict: Runtime Error):
s = [int(input()) for i in range(5)]
k = int(input())
count =	0

for i in s:
    for j in s:
        if (i-j)**2 > k**2:
            print(":(")
            count+=1
	    break

if count == 0:
    print("Yay!")



Fixed submission:
s = [int(input()) for i in range(5)]
k = int(input())
count = 0

for i in s:
    for j in s:
        if (i-j)**2 > k**2:
            print(":(")
            count+=1
            break
    if count == 1:
        break

if count == 0:
    print("Yay!")
Buggy python submission (verdict: Runtime Error):
import numpy as np

n = float(input())
list = [int(input()) for i in range(5)]

l = np.array(list)

d = np.amin(l)
dm = np.argmin(l)
'''                                                                                 
if dm == 4:                                                                         
    print(int(n//d))                                                                
'''
else:
    print(int(n//d+5))

Fixed submission:
import numpy as np
import math

n = float(input())
list = [int(input()) for i in range(5)]

l = np.array(list)

d = np.amin(l)
dm = np.argmin(l)

print(int(math.ceil(n/d)+4))
Buggy python submission (verdict: Time Limit Exceeded):
import math

N = int(input())
list = input().split(" ")

for k in range(N):
    change = 0
    now = 0
    for i in range(N):
        if k != i:
            if now < int(list[i]):
                change += int(list[i])-now
                now = int(list[i])
            else:
                change += now-int(list[i])
                now = int(list[i])



    change += math.fabs(now)
    change = int(change)
    print(change)


Fixed submission:
import math

N = int(input())
list = input().split(" ")
list.insert(0,"0")
list.append("0")

change = 0
now = 0
for i in range(N+1):
    if now < int(list[i]):
        change += int(list[i])-now
        now = int(list[i])
    else:
        change += now-int(list[i])
        now = int(list[i])
change += math.fabs(now)
change = int(change)

for i in range(1,N+1):
   ans = change - math.fabs(int(list[i])-int(list[i-1]))
   ans = ans - math.fabs(int(list[i+1])-int(list[i]))
   ans = ans + math.fabs(int(list[i+1])-int(list[i-1]))
   ans = int(ans)
   print(ans)
Buggy python submission (verdict: Runtime Error):
a=input()
b=input()
c=input()

if a<c and b>c :
  print("Yes")
elif a>c and b<c :
  print("Yes")
else:
  print("No")


Fixed submission:
x=input().split()
z=[int(v) for v in x]

if z[0]<z[2] and z[1]>z[2] :
  print("Yes")
elif z[0]>z[2] and z[1]<z[2] :
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
a=input()
b=input()
c=input()

if a<c and b>c :
  print("Yes")
elif a>c and b<c :
  print("Yes")
else:
  print("No)

Fixed submission:
x=input().split()
z=[int(v) for v in x]

if z[0]<z[2] and z[1]>z[2] :
  print("Yes")
elif z[0]>z[2] and z[1]<z[2] :
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
x=input()
if x=="A" :
    print("T")
elif x=="C" :
    print("G")
elif x=="G" :
    print("C")
else:
    print(A)

Fixed submission:
x=input()
if x=="A" :
    print("T")
elif x=="C" :
    print("G")
elif x=="G" :
    print("C")
else:
    print("A")
Buggy python submission (verdict: Runtime Error):
import numpy as np
import sys
X = int(input())
if X==1:
    print('1')
    sys.exit()
maxnum = 0
for i in range(2,int(np.sqrt(X))+1):
    num = i
    while num <= X:
        num *= i
        if num/i >maxnum:
            maxnum = num/i
print(int(maxnum))

Fixed submission:
a,b,c,d = [int(i) for i in input().split()]
if abs(b-a)<=d and abs(c-b)<=d:
    print('Yes')
elif abs(c-a)<=d:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
import numpy as np
import sys
X = int(input())
if X==1:
    print('1')
    sys.exit()
maxnum = 0
for i in range(2,int(np.sqrt(X))+1):
    num = i
    while num <= X:
        num *= i
        if num/i >maxnum:
            maxnum = num/i
print(int(maxnum))
    

Fixed submission:
a,b,c,d = [int(i) for i in input().split()]
if abs(b-a)<=d and abs(c-b)<=d:
    print('Yes')
elif abs(c-a)<=d:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()

ans = N
left_black = [0]
right_white = [0]

for i in range(N):
    if S[i] == '#':
        left_black.append(left_black[-1] + 1)
    else:
        left_black.append(left_black[-1])
    if S[N - 1 - i] == '.':
        right_white.insert(0, right_white[0] + 1)
    else:
        right_white.insert(0, right_white[0])

for i in range(N + 1):
    ans = min(ans, left_black[i] + right_white[i])
print(ans)


Fixed submission:
N = int(input())
S = input()

one, d = 0, 0
for i in range(N):
    if S[i] == '#':
        one += 1
    elif d > one - (i + 1 - one):
        d = one - (i + 1 - one)
print(d + N - one)
Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
a = list(map(int, input().split()))
ans = a[0]
for i in range(1, n):
    ans = math.gcd(ans, a[i])
print(ans)


Fixed submission:
def gcd(m, n):
    return m if n == 0 else gcd(n, m % n)


n = int(input())
a = list(map(int, input().split()))
ans = a[0]
for i in range(1, n):
    ans = gcd(ans, a[i])
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
list=[int(input()) for i in range(n)]
max = 0
a = 0
for i in range(n):
  for j in range(n):
    a = abs(list[i] - list[j])
    if a > max:
      max = a
      
if max <= 15:
  print('Yey!')
else:
  print(':(')
    

Fixed submission:
n = 5
list=[int(input()) for i in range(n)]
p = int(input())
max = 0
a = 0
for i in range(n):
  for j in range(n):
    a = abs(list[i] - list[j])
    if a > max:
      max = a
      
if max <= p:
  print('Yay!')
else:
  print(':(')