#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long int n;
  cin >> n;
  string s;
  cin >> s;
  long long int start = 0;
  for (long long int i = 0; i < s.size(); i++) {
    if (s[i] == '#') {
      start = i;
      break;
    }
  }
  long long int end = 0;
  for (long long int i = s.size() - 1; i >= 0; i--) {
    if (s[i] == '.') {
      end = i;
      break;
    }
  }
  s = s.substr(start, s.size() - start - (s.size() - end - 1));
  long long int white = 0;
  long long int black = 0;
  for (long long int i = 0; i < s.size(); i++) {
    if (s[i] == '#') {
      black++;
    } else {
      white++;
    }
  }
  cout << min(white, black) << endl;
}
