#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N;
  cin >> N;
  char S[N];
  cin >> S;
  int a[N];
  int b[N];
  if (S[0] == '.') {
    a[0] = 1;
    b[0] = 0;
  } else {
    a[0] = 0;
    b[0] = 1;
  }
  for (int i = 1; i < N; i++) {
    if (S[i] == '.') {
      a[i] = a[i - 1] + 1;
      b[i] = b[i - 1];
    } else {
      a[i] = a[i - 1];
      b[i] = b[i - 1] + 1;
    }
  }
  int ans = 1 << 10;
  for (int i = 0; i < N - 1; i++) {
    ans = min(ans, b[i] + a[N - 1] - a[i]);
  }
  ans = min(ans, a[N - 1]);
  cout << ans << endl;
}
