#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int fbb = -1, w = 0, b = 0;
  bool fb = true;
  int i;
  for (i = n - 1; 0 <= i; i--) {
    if (i == n - 1) {
      if (s.at(i) == '#') {
        fbb = 1;
      } else {
        fbb = 0;
        fb = false;
        w++;
      }
    } else if (fb == true) {
      if (s.at(i) == '#') {
        fbb++;
      } else {
        fb = false;
        w++;
      }
    } else {
      if (s.at(i) == '#') {
        b++;
      } else {
        w++;
      }
    }
  }
  fbb = max(0, fbb);
  cout << min(b, min(w, b + fbb)) << endl;
  return 0;
}
