a = int(input())
b = str(input())
res = 0

for i in range(a):
    if b[i:i+2] == "#.":
        res = b[i:a].count(".")
        break
        
for i in range(a,-1,-1):
    if b[i:i+2] == "#.":
        res = min(b[0:i+2].count("#"),res)
        break

for i in range(a):
    if b[i:i+2] == "#.":
        if res == 0:
            res = 10000
        res = min(b[i:a].count(".")+b[0:i+1].count("#"),res)
        
print(res)
