import re
n = int(input())
s = input()
if not '#' in s:
    print(0)
else:
    s = '#' + s.split('#', 1)[-1]
    ptn = re.search(re.compile('\.#+$'), s)
    if ptn:
        s = s[:ptn.start()] + '.'
    print(min(s.count('.'), s.count('#')))