n=int(eval(input()))

s=eval(input())

w_cnt=s.count(".")



ans=[w_cnt]

b=0

w=w_cnt



for i in range(n):

    if s[i]=="#":

        b+=1

    else:

        w-=1

    ans.append(b+w)



print((min(ans)))
n=int(eval(input()))

s=eval(input())

w_cnt=s.count(".")



ans=[w_cnt]

b=0

w=w_cnt



for i in s:

    if i=="#":

        b+=1

    else:

        w-=1

    ans.append(b+w)



print((min(ans)))

n = int(eval(input()))
s = eval(input())
w_cnt = s.count(".")
ans = [w_cnt]
b = 0
w = w_cnt
for i in range(n):
    if s[i] == "#":
        b += 1
    else:
        w -= 1
    ans.append(b + w)
print((min(ans)))

n = int(eval(input()))
s = eval(input())
w_cnt = s.count(".")
ans = [w_cnt]
b = 0
w = w_cnt
for i in s:
    if i == "#":
        b += 1
    else:
        w -= 1
    ans.append(b + w)
print((min(ans)))

-for i in range(n): -    if s[i] == "#": +for i in s: +    if i == "#":