#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int black = 0;
  int white = 0;
  int ba[n + 1];
  int wa[n + 1];
  int m = 1 << 30;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      black++;
    }
    ba[i] = black;
  }
  ba[n] = black;
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '.') {
      white++;
    }
    wa[i] = white;
  }
  wa[n] = 0;
  for (int i = 1; i <= n; i++) {
    cerr << m << endl;
    cerr << "(" << ba[i - 1] << " " << wa[i] << ")" << endl;
    m = min(ba[i - 1] + wa[i], m);
    if (ba[i - 1] + wa[i] == n) {
      m = 0;
    }
  }
  if (black == n) {
    m = 0;
  }
  cout << m << endl;
  return 0;
}
