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