#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long N;
  string S;
  cin >> N >> S;
  int count = 0;
  int index = 0;
  while (S[index] == '.') index++;
  for (int i = index; i < N; i++)
    if (S[i] == '.') count++;
  int white = 0;
  for (int i = 0; i < S.size(); i++) {
    if (S[i] == '.') white++;
  }
  cout << min(count, min(white, (int)(N)-white)) << endl;
}
