n = int(input())
s = input()
cmp1,cmp2 = 0,0
i = 0
if s.count('.') == n:
    print('0')
else:
    cmp1 = s[s.index('#'):].count('.')
    while s[i:].count('.') != 0:
        if s[i] == '#':
            cmp2 += 1
        i += 1
    print(min(cmp1,cmp2))
