l = int(input())
ss = input()
dn = ss.count('.')
dc = 0
if l != dn:
    for i in range(l):
        dc = dc + 1 if ss[i] == '.' else dc
        if dn/2 < dc:
            bits = ''.join(list(map(lambda s: '0' if s == '.' else '1', ss)))
            sbits = (''.join('0' for _ in range(dc))).join('1' for _ in range(l-dc))
            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)