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