#include <bits/stdc++.h>
using namespace std;
long long n, m, a, b, ans;
long long v[100009], p[100009];
int main() {
  cin >> n;
  string sh;
  cin >> sh;
  for (int i = 0; i < sh.size(); i++) {
    if (sh[i] == '#') {
      a++;
    }
  }
  for (int i = 0; i < sh.size(); i++) {
    if (sh[i] == '.') {
      b++;
    }
  }
  cout << min(a, b) << endl;
  return 0;
}
