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

cnt = 0

for i in range(n):
    if s[i] == "#":
        cnt +=1

x = 2*10**5


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

    w = n  - i - cnt + b

    x = min(x,b+w,n-b-w)

print(x)
