#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  string s;
  cin >> n;
  cin >> s;
  int cnt_black[n];
  int cnt_white[n];
  int cnt_change[n];
  for (int i = 0; i < n; i++) {
    if (i > 0) {
      cnt_black[i] = cnt_black[i - 1];
    } else {
      cnt_black[i] = 0;
    }
    if (s[i] == '#') {
      cnt_black[i] += 1;
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    if (i < n - 1) {
      cnt_white[i] = cnt_white[i + 1];
    } else {
      cnt_white[i] = 0;
    }
    if (s[i] == '.') {
      cnt_white[i] += 1;
    }
  }
  for (int i = 0; i < n; i++) {
    if (i < n - 1) {
      cnt_change[i] = cnt_black[i] + cnt_white[i + 1];
    } else {
      cnt_change[i] = cnt_black[i];
    }
  }
  int min = n;
  for (int i = 1; i < n; i++) {
    if (cnt_change[i] < min) {
      min = cnt_change[i];
    }
  }
  cout << min;
  return 0;
}
