#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, tmpAns;
  string s;
  int ans = 200000;
  int blackChanged = 0;
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') {
      continue;
    }
    tmpAns = blackChanged;
    for (int j = i + 1; j < n; j++) {
      if (s[j] == '.') {
        tmpAns++;
      }
    }
    blackChanged++;
    if (ans > tmpAns) {
      ans = tmpAns;
    }
  }
  if (ans > blackChanged) {
    ans = blackChanged;
  }
  cout << ans;
  return 0;
}
