using System;
using System.Linq;
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[] ind = new int[n];
    Parallel.For(0,n,i=>{
      ind[i] = CC(s.Substring(0,i),"#")+CC(s.Substring(i,n-i),".");
    });
    Console.WriteLine(ind.Min().ToString());
  }
  
  int CC(string str, string c){
    return (str.Length - str.Replace(c,"").Length);
  }
  
}


