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

if N == 1:
    print(0)
    exit()
if N == 2:
    if S[0] == "#" and S[1] == ".":
        print(1)
    else:
        print(0)
    exit()

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

print(ans)
