#include <bits/stdc++.h>
using namespace std;
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  reverse(s.begin(), s.end());
  bool b = false;
  int bc = 0;
  int wc = 0;
  for (unsigned long long i = 0; i < (n); ++i) {
    if (b && s[i] == '#') {
      bc++;
    } else if (s[i] == '.') {
      b = true;
      wc++;
    }
  }
  cout << min(wc, bc);
}
