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