n=int(input())
s=list(input())
t=0
k=0
for i in range(n-1):
    if s[i]=="#":
        if s[i+1]==".": # "#."
            t+=1
            s[i+1]="#"
        else: # "##"
            continue
    else: #s[i]=="."
        continue
print(t)