#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  vector<int> v_b(s.size()), v_w(s.size());
  int cnt_b = 0, cnt_w = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s.at(i) == '#') {
      cnt_b++;
    }
    if (s.at(i) == '.') {
      cnt_w++;
    }
    v_b.at(i) = cnt_b;
    v_w.at(i) = cnt_w;
  }
  int ans = 1000000000;
  for (int i = 0; i < s.size(); i++) {
    int tmp = 0;
    tmp += v_b.at(i);
    tmp += v_w.at(n - 1) - v_w.at(i);
    ans = min(ans, tmp);
  }
  cout << ans << endl;
}
