#include <bits/stdc++.h>
using namespace std;
 
int main() {
  long ;
  string S;
  cin >> N >> S;
  int color;
  vector<int> vec;
  if(S.at(0) == '.'){
      color = 0;
  }
  else{
      color = 1;
  }
  for(int i = 1;i < N;i++){
      if(S.at(i) != S.at(i-1)){
          vec.push_back(i);
      }
  }
  int minimum = N;
  if(vec.size() == 0){
      minimum = 0;
  }
  else if(color == 0){
    for (int i = 0; i < vec.size(); i += 2) {
      int sum = 0;
      for (int j = 1;j < i; j += 2){
          sum +=(vec.at(j) - vec.at(j-1));
      }
      for (int k = i + 2;k < vec.size(); k += 2){
          sum +=(vec.at(k) - vec.at(k-1));
      }
      if(vec.size() % 2 == 0){
          sum += ( N - vec.at(vec.size() - 1));
      }
      minimum = min(minimum,sum);
    }  
  }
  else if(color == 1){
    for (int i = 1; i < vec.size(); i += 2) {
      int sum = 0;
      sum += vec.at(0);
      for (int j = 1;j < i; j += 2){
          sum +=(vec.at(j) - vec.at(j-1));
      }
      for (int k = i + 2;k < vec.size(); k += 2){
          sum +=(vec.at(k) - vec.at(k-1));
      }
      if(vec.size() % 2 == 1){
          sum += ( N - vec.at(vec.size() - 1));
      }
      minimum = min(minimum,sum);
    }  
  }
  cout << minimum << endl;
}