#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int MOD = 1000000007;
const int iINF = 1001001001;
const long long llINF = 1LL << 60;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int bpos = s.find("#");
  int wpos = s.rfind(".");
  int bnum, wnum;
  bnum = wnum = 0;
  if (bpos == string::npos || wpos == string::npos) {
    cout << 0 << endl;
    return 0;
  }
  for (int i = bpos; i < n; ++i) {
    if (s[i] == '.') bnum++;
  }
  for (int i = 0; i < (wpos); ++i) {
    if (s[i] == '#') wnum++;
  }
  cout << min(bnum, wnum) << endl;
  return 0;
}
