#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, b = 0, w = 0;
  string s;
  cin >> n;
  cin >> s;
  int k = n - 1;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      k = i;
      break;
    }
  }
  for (int i = n - 1; i > k; i--) {
    if (s[i] == '.') {
      w++;
    } else {
      b++;
    }
  }
  cout << max(w, b) << endl;
  return 0;
}
