#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int x = 0;
  int y = 0;
  string s;
  int count = 0;
  cin >> s;
  for (int i = 0; i <= (n - 1); ++i) {
    if (s[i] == '#') {
      ++x;
    } else {
      ++y;
    }
  }
  cout << min(x, y) << endl;
  return 0;
}
