#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  long long hoge;
  cin >> hoge >> s;
  vector<signed> v(s.length());
  long long cnt = 0;
  for (long long i = 0; i < s.length(); i++) {
    if (s[i] == '#') {
      cnt++;
    }
    v[i] = cnt;
  }
  long long ans = 30000000;
  ans = min<long long>(v.back(), s.length() - v.back());
  char before = '1';
  for (long long i = 0; i < s.length(); ++i) {
    if (s[i] != before) {
      before = s[i];
      if (s[i] == '.') {
        continue;
      }
      long long costwhite = 0;
      if (i > 0) {
        costwhite = v[i - 1];
      }
      long long len = s.length() - i;
      long long costblack = len - v[i];
      long long cost = costwhite + costblack;
      long long ans = min(ans, cost);
    }
  }
  cout << ans << endl;
}
