import sys



N, S = int(sys.stdin.readline()), sys.stdin.readline()



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, S = int(eval(input())), eval(input())

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

ans = b + w

for si in S:

    if si == "#":

        b += 1

    else:

        w -= 1

    ans = min(ans, b + w)

print(ans)

import sys

N, S = int(sys.stdin.readline()), sys.stdin.readline()
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, S = int(eval(input())), eval(input())
b, w = 0, S.count(".")
ans = b + w
for si in S:
    if si == "#":
        b += 1
    else:
        w -= 1
    ans = min(ans, b + w)
print(ans)

-import sys - -N, S = int(sys.stdin.readline()), sys.stdin.readline() +N, S = int(eval(input())), eval(input()) -    if si == ".": +    else: