#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  vector<int> w;
  vector<int> b;
  vector<int> turn;
  cin >> n;
  cin >> s;
  w.push_back(0);
  b.push_back(0);
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      w.push_back(w[i]);
      b.push_back(b[i] + 1);
    } else {
      w.push_back(w[i] + 1);
      b.push_back(b[i]);
    }
  }
  if (w[n] == 0 || b[n] == 0) {
    cout << 0 << endl;
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    turn.push_back(b[i - 1] + (w[n] - w[i]));
  }
  cout << turn[*min_element(turn.begin(), turn.end())] << endl;
  return 0;
}
