#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  string result;
  int white = 0;
  int black = 0;
  int change_cnt = 0;
  char change_init = s[0];
  char change_before = s[0];
  for (int i = 0; i < n; i++) {
    if (change_before != s[i]) {
      change_cnt++;
      change_before = s[i];
    }
    if ((change_init == '#') || (change_init == '.' && 1 <= change_cnt)) {
      if (s[i] != '.') {
        white++;
      } else {
        black++;
      }
    }
  }
  if (1 == change_cnt && '.' == change_init) {
    cout << 0 << endl;
  } else {
    if (white < black) {
      cout << white << endl;
    } else {
      cout << black << endl;
    }
  }
  return 0;
}
