using System;
using System.Threading.Tasks;
class program{
  static void Main(string[] args){
    program p = new program();
    p.Run();
  }
  void Run(){
	int n = int.Parse(Console.ReadLine());
    string s = Console.ReadLine();
    int m=n;
    int[] l=new int[n+1];
    int[] r=new int[n+1];
    Parallel.For(0,n+1,i=>{
      l[i]=lookup(s.Substring(0,i),"#");
      r[i]=lookup(s.Substring(i,n-i),".");
      if(l[i]+r[i]<m){
        m=l[i]+r[i];
      }
    });
    Console.WriteLine(m.ToString());
    
  }
  
  int lookup(string s,string c){
    return s.Length - s.Replace(c,"").Length;
  }
}