#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, aa, bb;
  aa = 0;
  bb = 0;
  cin >> n;
  string s;
  cin >> s;
  for (int i = 0; i <= s.length() - 1; i++) {
    if (s[i] == '#') {
      if (i != s.length()) {
        aa++;
      }
    } else if (s[i] == '.') {
      bb++;
    }
  }
  cout << min(aa, bb) << "\n";
}
