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