#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int n;
  cin >> n;
  cin >> s;
  int cnt = 0;
  int cnt_kome = 0;
  int dum;
  size_t found = s.find('#');
  if (found != string::npos) {
    dum = static_cast<int>(found);
  } else {
    dum = 3 * pow(10, 5);
  }
  if (dum != 3 * pow(10, 5)) {
    for (int i = dum; i < s.size(); i++) {
      if (s[i] == '.') cnt++;
    }
  }
  found = s.rfind('.');
  if (found != string::npos) {
    dum = static_cast<int>(found);
  } else {
    dum = 3 * pow(10, 5);
  }
  if (dum != 3 * pow(10, 5)) {
    for (int i = dum; i >= 0; i--) {
      if (s[i] == '#') cnt_kome++;
    }
  }
  cout << min(cnt, cnt_kome) << endl;
}
