#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  string S;
  cin >> N >> S;
  long long cnt1 = 0;
  long long cnt2 = 0;
  long long inipos1 = S.find("#");
  if (inipos1 == -1) {
    cout << 0 << endl;
  } else {
    for (long long i = inipos1; i < N; i++) {
      if (S[i] == '.') cnt1++;
    }
  }
  long long inipos2 = S.rfind(".");
  if (inipos2 == -1) {
    cout << 0 << endl;
  } else {
    for (long long i = inipos2; i >= 0; i--) {
      if (S[i] == '#') cnt2++;
    }
  }
  cout << min(cnt1, cnt2) << endl;
  return 0;
}
