#include <iostream>
#include <string>
#include <algorithm>

int main(){
  int N;
  std::string str;
  std::cin>>N;
  std::cin>>str;
  int dotcount=0;
  int shapecount = 0;
  int totalcount = 0;
  std::vector<int> v;

  for(int i = 1;i<N;i++ ){
    for(int k=0;k<i;k++){
      if(str[k]=='#') shapecount++;
    }
    for(int k=i ; k<N ;k++){
      if(str[k]=='.') dotcount++;
    }
    v.push_back(shapecount+dotcount);
    shapecount=0; dotcount=0;
  }
  for(int i = 0; i < N ; i++ ){
    if(str[i]=='#') shapecount++;
  }
  v.push_back(shapecount);
  int min = *std::min_element(v.begin(),v.end());
  std::cout<<min<<std::endl;
  return 0;
}
