#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string s;
  cin >> s;
  vector<int> wh(N + 1, 0);
  vector<int> bl(N + 1, 0);
  for (int i = 0; i < (int)s.length(); i++) {
    if (s[i] == '.') {
      wh[i + 1] = wh[i] + 1;
      bl[i + 1] = bl[i];
    } else {
      bl[i + 1] = bl[i] + 1;
      wh[i + 1] = wh[i];
    }
  }
  int ans = N;
  for (int i = 1; i < N; i++) {
    ans = min(ans, bl[i] + wh[N] - wh[i - 1]);
  }
  cout << ans << endl;
  return 0;
}
