#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  string s;
  cin >> n >> s;
  int c, d;
  c = d = 0;
  char prev = s[0];
  bool fla1, fla2;
  fla1 = fla2 = false;
  for (int i = 1; i < n; i++) {
    if (prev == '#' && s[i] == '.') {
      c += 1;
      fla1 = true;
    } else {
      prev = s[i];
    }
  }
  prev = s[n - 1];
  for (int i = n - 2; i >= 0; i--) {
    if (prev == '.' && s[i] == '#') {
      d += 1;
      fla2 = true;
    } else {
      prev = s[i];
    }
  }
  if (!fla1) {
    cout << d << endl;
  } else if (!fla2) {
    cout << c << endl;
  } else {
    cout << min(c, d) << endl;
  }
}
