#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int si[n], si2[n];
  for (int i = 0; i < n; i++) {
    if (s[i] == '.')
      si[n] = 0;
    else
      si[n] = 1;
    si2[i] = si[i];
  }
  int c = 0, lc = 9999;
  for (int i = 0; i < n; i++) {
    if (si2[i] == 1) {
      si2[i] = 0;
      c++;
    }
  }
  lc = min(lc, c);
  for (int i = n - 1; i >= 0; i--) {
    if (si[i] == 1) {
      c--;
    } else {
      c++;
    }
    lc = min(lc, c);
  }
  cout << lc;
}
