#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int b = 0, w = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#')
      b++;
    else
      w++;
  }
  int output = min(w, b);
  cout << output << endl;
  return 0;
}
