#include <bits/stdc++.h>
using namespace std;
int main(int argc, char **argv) {
  uint64_t N;
  cin >> N;
  string S;
  cin >> S;
  bitset<200001> bitS(0);
  for (uint64_t n = 0; n < N; ++n) {
    bitS[n] = S[n] == '.';
  }
  uint64_t count = -1;
  bitset<200001> bitT(0);
  for (uint64_t n = 0; n < N + 1; ++n) {
    count = min(count, (bitS ^ bitT).count());
    bitT[n] = true;
  }
  cout << count << endl;
  return 0;
}
