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

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