n = int(input())
s = input()
cmp1,cmp2 = 0,0

if s.count('.') == n:
    print('0')
else:
    cmp1 = s[s.index('#'):].count('.')
    cmp2 = s[s[::-1].index('#'):-1].count('#')
    print(min(cmp1,cmp2))
