#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  bool dirty = false;
  int w_count = 0;
  int b_count = 0;
  for (int i = n - 1; i >= 0; --i) {
    char c = s[i];
    if (dirty) {
      if (c == '#')
        ++b_count;
      else
        ++w_count;
    } else {
      if (c == '.') {
        dirty = true;
        w_count = 1;
      }
    }
  }
  if (dirty && (b_count == 0) && (w_count * 2 >= n))
    cout << n - w_count << endl;
  else
    cout << min(w_count, b_count) << endl;
  return 0;
}
