#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int flag = 0;
  int count_b[n];
  int count_w[n];
  int count = 0;
  fill_n(count_b, n, 0);
  fill_n(count_w, n, 0);
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      count++;
    }
    count_b[i] = count;
  }
  int ans = 10000;
  int cb_r = 0;
  int cw_r = 0;
  int cb_l = 0;
  int cw_l = 0;
  if (count_b[n - 1] == 0 || count_b[n - 1] == n) {
    cout << 0 << endl;
    return 0;
  }
  for (int i = 0; i < n; i++) {
    cb_r = (count_b[n - 1] - count_b[i]);
    cw_r = (n - 1) - i - cb_r;
    cb_l = count_b[i] - count_b[0];
    cw_l = (i)-cb_l;
    ans = min(ans, cw_l + cw_r);
  }
  cout << ans << endl;
}
