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

for i in range(N - 1):
    if i == 0:
        if T[i] == "#" and T[i + 1] == ".":
            T[i] = "."
    else:
        if T[i] == "#" and T[i + 1] == ".":
            if T[i - 1] == ".":
                T[i] = "."
            else:
                T[i + 1] = "#"

ans = 0
for i in range(N):
    if S[i] != T[i]:
        ans += 1

print(ans)
