#include <bits/stdc++.h>
using namespace std;
int cntw[500000], cntb[500000];
int main() {
  int n;
  cin >> n;
  char s[500000];
  for (int i = 0; i < n; i++) {
    cin >> s[i];
  }
  memset(cntw, 0, sizeof(cntw));
  memset(cntb, 0, sizeof(cntb));
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') {
      cntw[i + 1] = cntw[i] + 1;
      cntb[i + 1] = cntb[i];
    } else {
      cntb[i + 1] = cntb[i] + 1;
      cntw[i + 1] = cntw[i];
    }
  }
  int minn = 1000000;
  for (int i = 1; i <= n; i++) {
    if (cntb[i] + cntw[n] - cntw[i] <= minn) {
      minn = cntb[i] + cntw[n] - cntw[i];
    }
  }
  cout << minn;
  return 0;
}
