import re
n = input()
N = int(n)

S = input()

pattern = r'\#+\.+'
repatter = re.compile(pattern)
result = repatter.findall(S)

ans = 0
for r in result:
    size = len(r)
    if size == 2:
        ans += 1
    else:
        Bsize = r.count('#')
        if Bsize < size - Bsize:
            ans += Bsize
        else:
            ans += size - Bsize
print(ans)
