N=int(input())
S=list(input())
 
count=0
    
if N!=1:
    for i in range(1,N):
        if S[i-1]=="#":
            if S[i]=="#":
               count=count+0
            elif S[i]==".":
                count=count+1
             #S[i]=change_string(S[i])
print(count)
      
    
  


