#include <bits/stdc++.h>
using namespace std;
long long w[222222], b[222222];
signed main() {
  long long n;
  string s;
  cin >> n >> s;
  bool can = true;
  w[0] = 0;
  b[0] = 0;
  for (long long i = 0; i < n; i++) {
    if (s[i] == '#') {
      w[i + 1] = 1;
      can = false;
    } else {
      b[i + 1] = 1;
    }
  }
  for (long long i = 0; i < n + 1; i++) {
    w[i + 1] += w[i];
    b[i + 1] += b[i];
  }
  if (can) {
    cout << 0 << endl;
    return 0;
  }
  long long ans = 10000000000000000;
  for (long long i = 0; i < n - 1; i++) {
    ans = min(ans, b[i + 1] - b[0] + w[n - 1] - w[i]);
  }
  cout << ans << endl;
}
