#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int A, B = 0, D = 0;
  cin >> A;
  vector<char> P(A, '#');
  vector<char> Q(A, '.');
  string S;
  cin >> S;
  for (int i = 0; i < A; i++) {
    if (S[i] != P[i]) B++;
    if (S[i] != Q[i]) D++;
  }
  cout << min(B, D) << endl;
}
