#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  int dum;
  int res = 0;
  size_t found = s.find("#.");
  if (found != string::npos) {
    for (int i = static_cast<int>(found) + 1; i < s.size(); i++) {
      if (s[i] == '.') res++;
    }
  }
  int cnt = 0;
  int tmp = 1;
  while (found != string::npos) {
    cnt = 0;
    found = s.find("#.", found + 1);
    if (found != string::npos) {
      cnt += tmp;
      for (int i = static_cast<int>(found) + 1; i < s.size(); i++) {
        if (s[i] == '.') cnt++;
      }
      res = min(res, cnt);
    }
    tmp++;
  }
  cout << res << endl;
}
