N = int(input())
S = list(input())

w = S.count(".")
b = S.count("#")

if w > b:
    change = "."

ans = 0
for i in range(N-1):
    if S[i] == "#" and S[i+1] == ".":
        if w > b:
            S[i] = "."
        else:
            S[i+1] = "#"
        ans += 1
print(ans)