#include <bits/stdc++.h>
using namespace std;
int main(void) {
  bool judge = false;
  int n, countS = 0, countC = 0;
  string s;
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      countS++;
    }
    if (s[i] == '#' && !judge) {
      judge = true;
      continue;
    }
    if (judge && s[i] == '.') {
      countC++;
    }
  }
  cout << min(countS, countC) << endl;
  return 0;
}
