n = int(input())
s = input()
kuro = 0
siro = 0
p = 0 
for i in range(n):
    if p == 0 and s[i] == "#":
        p = 1
    if p == 1 and s[i] == ".":
        siro += 1

p = 0
for i in reversed(range(n)):
    if p == 0 and s[i] == ".":
        p = 1
    if p == 1 and s[i] == "#":
        kuro += 1
        
print(min(siro,kuro))