import sys

n = int(sys.stdin.readline())
s = sys.stdin.readline()

bcnt = 0
wcnt = 0
bst = -1
lastlen = 0

for i in range(n):
    tmp = s[i:i + 1]
    if "#" in tmp:
        bcnt += 1
        if bst == -1:
            bst = i
        lastlen += 1
    elif "." in tmp:
        if bst >= 0:
            wcnt += 1
        lastlen = 0

print(min(wcnt, bcnt-lastlen))
