#include <bits/stdc++.h>
using namespace std;
int main() {
  int white = 0, black = 0;
  int black_last = 0;
  bool white_flag = 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;
      }
    } else if (c == '#') {
      if (!white_flag) {
        white_flag = true;
      }
      black++;
      black_last++;
    }
  }
  black -= black_last;
  int ans = 0;
  if (white <= black) {
    cout << white << endl;
  } else {
    cout << black << endl;
  }
}
