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

kuro = s.count("#")
shiro = s.count(".")
for i in range(n):
    s.append("#")

count = 0
for i in range(n):
    if s[i] == "#" and s[i+1] == ".":
        init = i+1
        break
for i in range(n):
    # #=kuro .=shiro

    if s[i] == "#" and s[i+1] == ".":
        c = 1
        for j in range(n):
            if s[i+j+2] == ".":
                c += 1
            else:
                break
        if count == 0 and init < c:
            c = init
        count += c
print(min(count,kuro,shiro))