#include <iostream>

using namespace std;

int main(){
  int N;
  int ham;
  std::string S;
  cin >> N >> S;
  int ham_min = N;
  std::string last = "";
  for (int index = 0; index< N+1; index++){
    for (int j=0;j<N;j++){
      if(index <= j){
        last[j] += "#";
      }
      else{
        last[j] += ".";
      }
    }
    ham = 0;
    for(int i=0; i<N; i++){
      if (S[i] != last[i]){
        ham++;
      }
    }
    if(ham < ham_min){
      ham_min = ham;
    }
  }
  std::cout << ham_min << std::endl;
  return 0;
}
