#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int t = n;
  for (int i = 0; i < n; ++i) {
    if (s[i] == '#') {
      t = i;
      break;
    }
  }
  int num_white = 0;
  for (int i = t; i < n; ++i) {
    if (s[i] == '.') ++num_white;
  }
  int num_black = (n - t) - num_white;
  cout << min(num_white, num_black) << endl;
  return 0;
}
