#include <bits/stdc++.h>
using namespace std;
int Result_int;
long Result_lng;
string Result_str = "";
long long N, left, t;
char S;
int main() {
  long long r_white = 0, r_black = 0, n;
  long long ignore_white = 0, ignore_black = 0;
  char white = '.';
  char black = '#';
  cin >> N;
  n = N - 1;
  for (long long i = 0; i < (n); i++) {
    cin >> S;
    if (S == white) {
      ignore_white++;
    } else {
      ignore_black++;
    }
    if (ignore_white && ignore_black) {
      r_white = ignore_white;
      r_black = ignore_black;
      t = i++;
      break;
    }
  }
  for (long long i = t; i < (n); i++) {
    cin >> S;
    if (S == white) {
      r_white++;
    } else {
      r_black++;
    }
  }
  if (ignore_black > ignore_white) {
    cout << r_white << endl;
  } else if (r_white > r_black) {
    cout << r_black << endl;
  } else {
    cout << r_white << endl;
  }
}
