#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  string S;
  cin >> N;
  cin >> S;
  int wc = 0, bc = 0, bwc = 0, counter = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '.') {
      wc++;
    }
  }
  bwc = wc;
  int ret;
  for (int i = 0; i < N; i++) {
    if (S[i] == '.') {
      bwc--;
    } else {
      bc++;
    }
    ret = min(ret, bc + bwc);
  }
  cout << ret << endl;
  return 0;
}
