#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int flagwhite = 0;
  int flagblack = 0;
  if (s.at(0) == '#') {
    flagblack++;
  }
  for (int i = 1; i < n - 1; i++) {
    if (s.at(i) == '.') {
      flagwhite++;
    } else if (s.at(i) == '#') {
      flagblack++;
    }
  }
  if (s.at(n - 1) == '.') {
    flagwhite++;
    if (flagblack <= flagwhite) {
      cout << flagblack << endl;
    } else {
      cout << flagwhite << endl;
    }
  } else if (s.at(n - 1) == '#') {
    if (flagblack <= flagwhite) {
      cout << flagblack << endl;
    } else {
      cout << flagwhite << endl;
    }
  }
  return 0;
}
