N = int(input())
S = list(input())
S1 = [s for s in S]
sharp = S.count("#")
dot = S.count(".")
ans1 = 0
for i in range(N-1):
    if S[i] == "#" and S[i+1] == ".":
        S[i+1] = "#"
        ans1 += 1

ans2 = 0
for i in range(1, N)[::-1]:
    if S1[i] == "." and S1[i-1] == "#":
        S1[i-1] = "."
        ans2 += 1
ans1 = min(dot, ans1)
ans2 = min(sharp, ans2)
print(min(ans1, ans2))
