#include <bits/stdc++.h>
using namespace std;
int main() {
  long N;
  long black_count = 0;
  long white_count = 0;
  long ans_count = 2e5 + 1;
  string S;
  cin >> N >> S;
  for (long i = 0; i < N; i++) {
    if (S[i] == '.') {
      white_count++;
    }
  }
  for (long i = 0; i < N; i++) {
    ans_count = min(ans_count, white_count + black_count);
    if (S[i] == '.') {
      white_count--;
    } else {
      black_count++;
    }
  }
  cout << ans_count << endl;
  return 0;
}
