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

now = s[0]
count=0
for i in range(0,n-1):
    if now == "#" and s[i+1]==".":
        if i > 0 and s[i-1]==".":
            count+=1
            now = "."
            continue
        count+=1
        continue
    now = s[i+1]
print(count)    