#include <bits/stdc++.h>
using namespace std;
int N;
string S;
vector<int> sct;
int solve() {
  if (S[0] == '#') sct.push_back(0);
  char prev = S[0];
  int sct_len = 0;
  S.push_back('A');
  for (int i = 0; i < S.size(); ++i) {
    if (S[i] == prev)
      ++sct_len;
    else {
      sct.push_back(sct_len);
      sct_len = 1;
    }
    prev = S[i];
  }
  if (S[S.size() - 2] == '.') sct.push_back(0);
  int wh = 0, bl = 0;
  for (int i = 1; i < sct.size() - 1; ++i) {
    if (i % 2 == 1) {
      bl += sct[i];
    } else {
      wh += sct[i];
    }
  }
  cout << min(wh, bl) << endl;
}
int main(int argc, char **argv) {
  cin >> N >> S;
  solve();
}
