N = int(input())
S = list(input())
sharp = S.count("#")
ans = 0
for i in range(N-1):
    if S[i] == "#" and S[i+1] == ".":
        S[i+1] = "#"
        ans += 1
"""s = 0
while s < N and S[s] == "." :
    s += 1
for i in range(s, N):
    if S[i] == ".":
        ans += 1"""
print(min(ans, sharp))
