#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++) {
    if (s[i] == '#') {
      cb_l = count_b[i] - 1;
      cw_r = (n - 1 - i) - (count_b[n - 1] - count_b[i]);
    } else {
      cb_l = count_b[i];
      cw_r = (n - 1 - i) - (count_b[n - 1] - count_b[i]);
    }
    if (cb_l < 0) cb_l = 0;
    if (cw_r < 0) cw_r = 0;
    ans = min(ans, cw_r + cb_l);
  }
  cout << ans << endl;
}
