l = int(input())
ss = input()
bits = ''.join(list(map(lambda s: '0' if s == '.' else '1', ss)))
n = bits.find('1')+1
if 0 <= n:
    sbits = (''.join('0' for _ in range(n))).join('1' for _ in range(l-n))
    c0 = bin(int(bits, 2) ^ int(sbits,2)).count('1')
    sbits = ''.join('1' for _ in range(l))
    c1 = bin(int(bits, 2) ^ int(sbits,2)).count('1')
    print(c0 if c0 < c1 else c1)
else:
    print(0)