#include <bits/stdc++.h>
using namespace std;
int main(void) {
  string s;
  int n;
  cin >> n >> s;
  int b_cnt, w_cnt;
  b_cnt = w_cnt = 0;
  vector<int> b_list(n, 0);
  vector<int> w_list(n, 0);
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == '#') {
      b_cnt++;
    } else if (s[i] == '.') {
      w_cnt++;
    }
    b_list[i] = b_cnt;
    w_list[i] = w_cnt;
  }
  int min_rev = n;
  for (int l = 0; l < s.length(); l++) {
    int rev = b_list[l] + (w_cnt - w_list[l]);
    min_rev = min(min_rev, rev);
  }
  if (b_cnt == 0 || w_cnt == 0) {
    min_rev = 0;
  }
  cout << min_rev << endl;
}
