#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int l = -1, r = -1, w = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#' && l == -1) {
      l = i;
    }
    if (s[i] == '.' && l != -1) {
      r = i;
      w++;
    }
  }
  if (r == -1) {
    cout << 0 << endl;
  } else {
    cout << min(w, r - l + 1 - w) << endl;
  }
  return 0;
}
