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