#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N;
  string S;
  cin >> N >> S;
  bool black_flag = false;
  bool white_flag = false;
  int counter_white = 0;
  int counter_black = 0;
  for (int i = 0; i < N; i++) {
    if ((!black_flag && S[i] == '.') || (black_flag && S[i] == '#')) {
      continue;
    } else if (!black_flag && S[i] == '#') {
      black_flag = true;
    } else {
      counter_white++;
    }
  }
  for (int i = 0; i < N; i++) {
    if ((!white_flag && S[i] == '#') || (white_flag && S[i] == '.')) {
      continue;
    } else if (!white_flag && S[i] == '.') {
      white_flag = true;
    } else {
      counter_black++;
    }
  }
  if (counter_white < counter_black) {
    cout << counter_white << '\n';
  } else {
    cout << counter_black << '\n';
  }
  return 0;
}
