#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n;
  string s;
  cin >> n >> s;
  bool can = true;
  long long w = 0;
  long long b = 10000000000000000;
  for (long long i = 0; i < n; i++) {
    if (s[i] == '#') {
      can = false;
      b = min(b, i);
    }
    if (s[i] == '.') w = max(w, i);
  }
  if (can) {
    cout << 0 << endl;
    return 0;
  }
  long long cnta = 0;
  for (long long i = 0; i < w; i++) {
    if (s[i] == '#') cnta++;
  }
  long long cntb = 0;
  for (long long i = b; i < n - 1; i++) {
    if (s[i] == '.' && s[i + 1] != '.') cntb++;
  }
  cout << min(cnta, cntb) << endl;
}
