#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ans = 0, cnt = 0, cnt2 = 0;
  string s;
  cin >> n >> s;
  bool ok = false;
  reverse(s.begin(), s.end());
  for (int i = 0; i < n; ++i) {
    if (s[i] == '.') {
      ok = true;
      ;
      ++cnt;
    } else {
      ++cnt2;
    }
    if (ok) {
      if (s[i] == '#') ++ans;
    }
  }
  cnt = min(cnt, cnt2);
  cout << min(ans, cnt) << endl;
  return 0;
}
