#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  bool flg;
  int wcnt = 0, bcnt = 0;
  for (int i = 0; i < s.size(); ++i) {
    if (flg)
      if (s[i] == '.') wcnt++;
    if (s[i] == '#') {
      flg = true;
      bcnt++;
    }
  }
  cout << min(wcnt, bcnt) << endl;
}
