#include <bits/stdc++.h>
using namespace std;
using P = pair<int, int>;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  int n;
  string s;
  cin >> n >> s;
  vector<int> kuro(n), siro(n);
  if (s[0] == '#')
    kuro[0] = 1;
  else
    siro[0] = 1;
  for (int i = 1; i < n; i++) {
    if (s[i] == '#') {
      kuro[i] = kuro[i - 1] + 1;
      siro[i] = siro[i - 1];
    } else {
      kuro[i] = kuro[i - 1];
      siro[i] = siro[i - 1] + 1;
    }
  }
  int ans = n;
  for (int i = 0; i < n; i++) {
    int ope;
    if (i == 0) {
      ope = min(siro[n - 1], kuro[n - 1]);
    } else {
      ope = min(kuro[i], siro[i]) + (n - siro[i]);
    }
    ans = min(ans, ope);
  }
  cout << ans << endl;
  return 0;
}
