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

s=eval(input())

a=[0]

for i in s:

    if i==".":a+=[a[-1]+1]

    else:a+=[a[-1]]

w=s.count(".")

for i in range(n+1):

    ans=min(ans,i-a[i]+w-a[i])

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

s=eval(input())

a=[0]

for i in s:

    if i==".":a+=[a[-1]+1]

    else:a+=[a[-1]]

w=s.count(".")

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

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

-ans = n = int(eval(input())) +n = int(eval(input())) -for i in range(n + 1): -    ans = min(ans, i - a[i] + w - a[i]) -print(ans) +print((min(i - a[i] + w - a[i] for i in range(n + 1))))