#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  bool exi = 0;
  int c1 = 0;
  for (int i = 0; i < n; i++) {
    if (!exi) {
      if (s[i] == '#') exi = 1;
    } else {
      if (s[i] == '.') c1++;
    }
  }
  reverse(s.begin(), s.end());
  exi = 0;
  int c2 = 0;
  for (int i = 0; i < n; i++) {
    if (!exi) {
      if (s[i] == '.') exi = 1;
    } else {
      if (s[i] == '#') c2++;
    }
  }
  cout << min(c1, c2) << endl;
}
