#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  s += '#';
  vector<int> countdot(n, 0);
  int countindexd = 0;
  for (int i = 0; i < n; i++) {
    if (s.at(i) == '.') {
      ++countdot.at(countindexd);
      if (s.at(i + 1) == '#') ++countindexd;
    }
  }
  int a = 0, b = 0, c = 0, d = 0;
  if (s.at(n) == '.') {
    if (s.at(0) == '.') {
      for (int i = 1; i < n; i++) {
        a += countdot.at(i);
      }
      cout << min(n - a, a) << endl;
    } else {
      for (int i = 0; i < n; i++) {
        b += countdot.at(i);
      }
      cout << min(n - b, b) << endl;
    }
  } else {
    if (s.at(0) == '.') {
      for (int i = 1; i < n; i++) {
        c += countdot.at(i);
      }
      cout << min(n - c, c) << endl;
    } else {
      for (int i = 0; i < n; i++) {
        d += countdot.at(i);
      }
      cout << min(n - d, d) << endl;
    }
  }
}
