n = int(eval(input()))

s = eval(input())

lis = []

ws=s.count('.')

lis.append(ws)

bs = 0

for x in s:

    if x == '#':

        bs += 1

        lis.append(bs+ws)

    else:

        ws -= 1

    lis.append(bs+ws)

print((min(lis)))

n = int(eval(input()))

s = eval(input())

bs = 0

ws = s.count('.')

ans = ws

for c in s:

    if c == '.':

        ws -= 1

    else:

        bs += 1

    now = ws + bs

    if ans > now:

        ans = now

print(ans)

n = int(eval(input()))
s = eval(input())
lis = []
ws = s.count(".")
lis.append(ws)
bs = 0
for x in s:
    if x == "#":
        bs += 1
        lis.append(bs + ws)
    else:
        ws -= 1
    lis.append(bs + ws)
print((min(lis)))

n = int(eval(input()))
s = eval(input())
bs = 0
ws = s.count(".")
ans = ws
for c in s:
    if c == ".":
        ws -= 1
    else:
        bs += 1
    now = ws + bs
    if ans > now:
        ans = now
print(ans)

-lis = [] +bs = 0 -lis.append(ws) -bs = 0 -for x in s: -    if x == "#": +ans = ws +for c in s: +    if c == ".": +        ws -= 1 +    else: -        lis.append(bs + ws) -    else: -        ws -= 1 -    lis.append(bs + ws) -print((min(lis))) +    now = ws + bs +    if ans > now: +        ans = now +print(ans)