n = int(input())
s = input()
cta = 0
ctb = 0
ind1 = s.find('#')
ind2 = s.rfind('.')
for i in range(ind1+1,len(s)):
    if s[i] == '.':
        cta += 1
for i in range(ind2):
    if s[i] == '#':
        ctb += 1
print(min(cta,ctb))