#include <bits/stdc++.h>
using namespace std;
int main() {
  long int n;
  string s;
  cin >> n >> s;
  long int first_black;
  bool flag = 0;
  for (long int i = 0; i < n; i++) {
    if (s[i] == '#') {
      first_black = i;
      flag = 1;
      break;
    }
  }
  if (!flag) {
    cout << 0 << endl;
    return 0;
  }
  long int last_white;
  for (long int i = n - 1; i >= 0; i--) {
    if (s[i] == '.') {
      last_white = i;
      break;
    }
  }
  long int white_cnt = 0;
  for (long int i = first_black; i < n; i++) {
    if (s[i] == '.') {
      white_cnt++;
    }
  }
  long int black_cnt = 0;
  for (long int i = 0; i <= last_white; i++) {
    if (s[i] == '#') {
      black_cnt++;
    }
  }
  cout << min(white_cnt, black_cnt) << endl;
  return 0;
}
