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