a = int(input())
b = input()
e = b
c = 0
d = 0
while b.count('#.') != 0 :
    c = c + b.count('#.')
    b = b.replace('#.','..')
while e.count('#.') != 0 :
    d = d + e.count('#.')
    e = e.replace('#.','##')
if c < d :
    print(c)
else :
    print(d)