#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int nr = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      nr++;
    }
  }
  int q = 0;
  for (int i = 0; i < nr; i++) {
    if (s[i] == '.') {
      q++;
    }
  }
  cout << nr - q << endl;
  return 0;
}
