# coding: utf-8
_ = int(input())
s = list(input()) + [' ']
try:
    sl = s[s.index('#'):]
    if sl.count('#') > sl.count('.'):
        print(sl.count('.'))
    else:
        print(sl.count('#'))
except:
    print(0)