N = int(eval(input()))

S = eval(input())

a = S.count('.')

ans = a

for i in S:

    a += -1 if i == '.' else 1

    ans = min(ans, a)

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

S = eval(input())

a = S.count('.')

ans = a



for i in S:

    if i == '.':

        a -= 1

    else:

        a += 1

    ans = min(ans, a)



print(ans)
N = int(eval(input()))
S = eval(input())
a = S.count(".")
ans = a
for i in S:
    a += -1 if i == "." else 1
    ans = min(ans, a)
print(ans)

N = int(eval(input()))
S = eval(input())
a = S.count(".")
ans = a
for i in S:
    if i == ".":
        a -= 1
    else:
        a += 1
    ans = min(ans, a)
print(ans)

-    a += -1 if i == "." else 1 +    if i == ".": +        a -= 1 +    else: +        a += 1