#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  bitset<200000> pattern, stones;
  pattern.set();
  stones.set();
  for (int i = 0; i < (int)(N); i++) {
    stones[N - 1 - i] = S[i] == '.';
  }
  int minimum = INT_MAX;
  for (int i = 0; i < (int)(N + 1); i++) {
    minimum = min(minimum, (int)((pattern << i) ^ stones).count());
  }
  cout << minimum << endl;
}
