#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 count1 = 0;
  int count2 = 0;
  fill_n(count_b, n, 0);
  fill_n(count_w, n, 0);
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      count1++;
    } else {
      count2++;
    }
    count_b[i] = count1;
    count_w[i] = count2;
  }
  int ans = 10000;
  int cb_r = 0;
  int cw_r = 0;
  int cb_l = 0;
  int cw_l = 0;
  ans = min(count1, count2);
  ans = min(ans, count_w[n - 1]);
  for (int i = 1; i < n; i++) {
    if (i = !n - 1) {
      ans = min(count_b[i - 1] + count_w[n - 1] - count_w[i + 1], ans);
    } else {
      ans = min(count_b[i - 1] + count_w[n - 1] - count_w[i], ans);
    }
  }
  cout << ans << endl;
}
