n = int(input())
s = input() + '#'

idx = s.index('#')

cnt = 0
for i in range(idx + 1, n):
    if s[i] == '.':
        cnt += 1

res1 = cnt
res2 = s.count('.')
res3 = s[:n].count('#')

print(min(res1, res2, res3))