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