#include <bits/stdc++.h>
using namespace std;
int main() {
  int Dot = 0, Sharp = 0;
  int n;
  cin >> n;
  string s;
  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    if (s.at(i) == '.') {
      Dot++;
    } else if (s.at(i) == '#') {
      Sharp++;
    }
  }
  cout << min(Dot, Sharp) << endl;
}
