#include<iostream>
#include<string>
#include<vector>
using namespace std;

int main(){
  long int n;
  cin >> n;
  string s;
  cin >> s;
  vector<char> S;
  vector<char> T;
  for(int i = 0;i < n;i++){
    S.push_back(s.at(i));
    T.push_back(s.at(i));
  }

  long int count_s = 0;
  for(int i = 1;i < n;i++){
    if(S[i-1] == '#' && S[i] == '.'){
      S[i] = '#';
      count_s++;
    }
  }

  ling int count_a = 0;
  for(int i = 0;i < n-1;i++){
    if(T[i] == '#'){
      T[i] = '.';
      count_a++;
    }
  }
  //cout << count_a << endl;
  cout << min(count_s,count_a) << endl;
}
