import sys

input = sys.stdin.readline
N = int(input())
S = list(input().strip())
S = S[::-1]

ans = 0
for i in range(N-2):
    if S[i] == ".":
        if S[i+1] == "." and S[i+2] == "#":
            S[i+2] = "."
            ans += 1
        if S[i+1] == "#":
            ans += 1
    elif S[i] == "#" and S[i+1] == "." and S[i+2] == "#":
        ans += 1
print(ans)