#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  string white, black;
  for (int i = 0; i < N; i++) white += '.', black += '#';
  int sum_white = 0, sum_black = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] != white[i]) sum_white++;
    if (S[i] != black[i]) sum_black++;
  }
  cout << min(sum_white, sum_black) << endl;
}
