#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int ans = 10000000;
  vector<int> b, w;
  char now = '.';
  int a = 0;
  if (S[N - 1] == '.')
    S = S + '#';
  else
    S = S + '.';
  for (int i = 0; i < (N + 1); i++) {
    if (S[i] == now)
      a++;
    else {
      if (now == '.')
        w.push_back(a);
      else
        b.push_back(a);
      a = 0;
      now = S[i];
      i--;
    }
  }
  b.push_back(0);
  int an = 0;
  for (int i = 0; i < (int(w.size())); i++) an += w[i];
  ans = an;
  for (int i = 0; i < (int(w.size())); i++) {
    an = an - w[i] + b[i];
    ans = min(ans, an);
  }
  cout << ans << endl;
  return 0;
}
