import sys

input = sys.stdin.readline
N = int(input())
S = list(input().strip())

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