import sys

def parse(inp):
    n=int(next(inp))
    s=list(next(inp))
    
    b=0
    for i in range(n-1,-1,-1):
        b=b<<1
        if(s[i]=="."): b+=1        
#     print(bin(b))    
    return n,b
  
def main(inp):
    n,b=inp
    
    std=0
    ans=n
    for i in range(n+1):
        ans=min(ans,bin(std^b).count("1"))
        std=(std<<1)+1
        
    return ans
  
print(main(parse(sys.stdin)))