#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int st = (int)1e8;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      st = i;
      break;
    }
  }
  if (st == (int)1e8) {
    cout << 0 << "\n";
    return 0;
  }
  int cnt = 0;
  for (int i = st; i < n; i++) {
    if (s[i] == '.') cnt++;
  }
  int cnt1 = 0;
  for (int i = st; i < n; i++) {
    if (s[i] == '#') cnt1++;
  }
  cout << min(cnt, cnt1) << "\n";
}
