n=int(input())
s=input()
b=0
w=0
bx=0
wx=0

for i in range(n):
    if s[i] == '#':
        b += 1
        wx = w
    elif s[i] == '.':
        bx = b
        if b>=1:
            w += 1
            wx = w

print(min(bx,wx))