#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ans = 100000000, ab = 0, aw = 0;
  string s;
  cin >> n >> s;
  vector<int> b(n), w(n);
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      ab++;
    }
    b.at(i) = ab;
  }
  cout << endl;
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '.') {
      aw++;
    }
    w.at(i) = aw;
  }
  for (int i = 1; i < n; i++) {
    if (s[i] == '#' && s[i - 1] == '.') {
      ans = min(ans, b.at(i - 1) + w.at(i));
    }
  }
  cout << ans;
}
