n = int(input())
s = input()
if all([v == '.' for v in s]):
    print(0)
else:
    r = 0
    s = s[s.find('#'):]
    while (True):
        k = s.find('.#') + 1
        if k == 0:
            r += min(s.count('.'), s.count('#'))
            break
        else:
            t = s[:k]
            r += min(t.count('.'), t.count('#'))
            s = s[k:]
    print(r)