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

a,b = 0,0
for i in s:
    if i == '.':
        a += 1 #白の個数
    else:
        b += 1 #黒の個数

min_c = 10**10
if s[0] == '.':
    counta, countb = 0, 0
    for k, i in enumerate(s):
        if s[k] == '.':
            counta += 1
        if s[k] == '#':
            countb += 1
            c = (a - counta) + (countb - 1)
        if min_c > c:
            min_c = c
        
print(min(a,b, min_c))