#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int j = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      j++;
    }
  }
  int k = N - j;
  if (j > k) {
    cout << k << endl;
  } else {
    cout << j << endl;
  }
  return 0;
}
