#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  bool b = false;
  int c = 0;
  int r = 10000;
  int black = 0;
  for (int i = 0; i < n; i++) {
    if (b == false && s[i] == '#') {
      b = true;
      c = black;
      for (int j = i; j < n; j++) {
        if (s[j] == '.') {
          c++;
        }
      }
      if (c < r) {
        r = c;
      }
    }
    if (s[i] == '#') {
      black++;
    } else {
      b = false;
    }
  }
  r = min(r, black);
  cout << r << endl;
  return 0;
}
