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

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

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

print(res)