N = int(eval(input()))

S = eval(input())



white = [0] * (N + 1)

black = [0] * (N + 1)

for i, si in enumerate(S):

    black[i + 1] = black[i]

    white[i + 1] = white[i]

    if si == "#":

        black[i + 1] += 1

    if si == ".":

        white[i + 1] += 1



mi = 10 ** 10

for i in range(N + 1):

    b = black[i]

    w = white[N] - white[i]

    mi = min(w + b, mi)

print(mi)

N, S = int(eval(input())), eval(input())

b, w = 0, S.count('.')

ans = b + w

for si in S:

    if si == "#":

        b += 1

    if si == ".":

        w -= 1

    ans = min(ans, b + w)

print(ans)

N = int(eval(input()))
S = eval(input())
white = [0] * (N + 1)
black = [0] * (N + 1)
for i, si in enumerate(S):
    black[i + 1] = black[i]
    white[i + 1] = white[i]
    if si == "#":
        black[i + 1] += 1
    if si == ".":
        white[i + 1] += 1
mi = 10**10
for i in range(N + 1):
    b = black[i]
    w = white[N] - white[i]
    mi = min(w + b, mi)
print(mi)

N, S = int(eval(input())), eval(input())
b, w = 0, S.count(".")
ans = b + w
for si in S:
    if si == "#":
        b += 1
    if si == ".":
        w -= 1
    ans = min(ans, b + w)
print(ans)

-N = int(eval(input())) -S = eval(input()) -white = [0] * (N + 1) -black = [0] * (N + 1) -for i, si in enumerate(S): -    black[i + 1] = black[i] -    white[i + 1] = white[i] +N, S = int(eval(input())), eval(input()) +b, w = 0, S.count(".") +ans = b + w +for si in S: -        black[i + 1] += 1 +        b += 1 -        white[i + 1] += 1 -mi = 10**10 -for i in range(N + 1): -    b = black[i] -    w = white[N] - white[i] -    mi = min(w + b, mi) -print(mi) +        w -= 1 +    ans = min(ans, b + w) +print(ans)