#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[224514], m = 1145141919, c;
  char cc;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> cc;
    if (cc == '.')
      a[i] = 0;
    else
      a[i] = 1;
  }
  for (int p = 0; p <= n; p++) {
    c = 0;
    for (int i = 0; i < n; i++) {
      if (i < p) {
        if (a[i] == 1) c++;
      } else {
        if (a[i] == 0) c++;
      }
    }
    m = min(m, c);
  }
  cout << m << endl;
}
