n = int(input())
s = input()

x = 2*10**5

for i in range(n+1):
    b = 0
    w = 0
    for j in range(i):
        if s[j] == "#":
            b = b + 1

    for j in range(i,n):
        if s[j] == ".":
            w = w + 1

    x = min(x,b+w)

print(x)