n = int(input())
s = input()

ans = 0
for i in range(n-2):
    if s[i]+s[i+1] == "#.":
        if s[i+2] == "#":
            s.replace(s[i+1],"#")
            ans += 1
        if s[i+2] == ".":
            s.replace(s[i+1],".")
            ans += 1
if s[-2]+s[-1] == "#.":
    s.replace(s[i+1],"#")
    ans += 1
print(ans)