n = int(input())
s = input()

s_bin = '0b' + s.replace('.', '0').replace('#', '1')
min_cost = n

for i in range(n+1):
    cand_s_bin = '0b' + ('0' * i) + ('1' * (n-i))
    diff = bin(int(s_bin, 2) ^ int(cand_s_bin, 2))
    cost = diff.count('1')
    if cost < min_cost:
        min_cost = cost

print(min_cost)
