#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  vector<int> vec(N);
  int Nsum = 0;
  for (int i = 0; i < N; i++) {
    if (S.at(i) == '.') {
      vec.at(i) = 1;
      Nsum++;
    } else {
      vec.at(i) = 0;
    }
  }
  int sum = 0;
  int flag = N;
  for (int i = 0; i < N; i++) {
    sum += vec.at(i);
    if ((i + Nsum + 1 - 2 * sum) < flag) {
      flag = 1 + i + Nsum - 2 * sum;
    }
  }
  cout << flag << endl;
  return 0;
}
