#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int i;
  int point = 1000000;
  int countb = 0;
  int chantob = 0;
  for (i = 0; i < n; i++) {
    if (s.at(i) == '#') {
      point = i;
      break;
    }
  }
  int countw = 0;
  for (i = 0; i < n; i++) {
    if (s.at(i) == '#') {
      countb++;
    } else {
      countw++;
    }
  }
  for (i = 0; i < n; i++) {
    if (i > point && s.at(i) == '.') {
      chantob++;
    }
  }
  if (point < n) {
    cout << min(countb, min(countw, chantob)) << endl;
  } else {
    cout << min(countb, countw) << endl;
  }
}
