#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  int black = 0;
  int white = 0;
  cin >> n;
  char s[n];
  cin >> s;
  for (int i = 0; i < n - 1; i++) {
    if (strncmp(s + i, "#", 1) == 0) black++;
    if (strncmp(s + i + 1, ".", 1) == 0) white++;
  }
  if (black < white) {
    cout << black << endl;
  } else {
    cout << white << endl;
  }
  return 0;
}
