#include <bits/stdc++.h>
using namespace std;
const long long MOD = (long long)1e9 + 7;
signed main() {
  long long N;
  string S;
  cin >> N >> S;
  bool f = false;
  long long cntw = 0, cntb = 0;
  for (long long i = 0; i < N; i++) {
    if (!f) {
      if (S[i] == '#') f = true;
    } else {
      if (S[i] == '.') cntw++;
    }
  }
  f = false;
  for (long long i = N - 1; i >= 0; i--) {
    if (!f) {
      if (S[i] == '.') f = true;
    } else {
      if (S[i] == '#') cntb++;
    }
  }
  cout << min(cntw, cntb) << endl;
}
