#include <bits/stdc++.h>
using namespace std;
int main() {
  int white = 0, black = 0;
  int white_second = 0;
  int black_last = 0;
  int black_first = 0;
  bool white_flag = false;
  bool black_flag = true;
  bool white_secondFlag = false;
  int n;
  char c;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> c;
    if (c == '.') {
      if (white_flag) {
        white++;
        black_last = 0;
      }
      if (black_flag) {
        black_flag = false;
      }
      if (white_secondFlag) {
        white_second++;
      }
    } else if (c == '#') {
      if (!white_flag) {
        white_flag = true;
      }
      if (black_flag) black_first++;
      if (!black_flag) {
        white_secondFlag = true;
      }
      black++;
      black_last++;
    }
  }
  black -= black_last;
  if ((black_first + white_second) < black &&
      (black_first + white_second) < white) {
    cout << black_first + white_second << endl;
  } else {
    if (white < black) {
      cout << white << endl;
    } else if (white > black) {
      cout << black << endl;
    }
  }
}
