#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1LL << 60;
int main() {
  ll N;
  cin >> N;
  string second;
  cin >> second;
  ll black = 0, white = 0;
  for (ll i = 0; i < N; i++) {
    if (second[i] == '#') {
      black++;
    } else {
      white++;
    }
  }
  cout << min(black, white) << "\n";
  return 0;
}
