#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int all_sharp = 0;
  int i = 0;
  while (i < N && S.at(i) == '.') {
    i++;
  }
  int start_sharp = i;
  i = 0;
  while (i < N && S.at(N - i - 1) == '#') {
    i++;
  }
  int end_dot = N - i - 1;
  for (i = start_sharp; i < N; i++) {
    if (S.at(i) == '.') {
      all_sharp += 1;
    }
  }
  int all_dot = 0;
  for (i = 0; i < end_dot; i++) {
    if (S.at(i) == '#') {
      all_dot += 1;
    }
  }
  if (all_sharp < all_dot) {
    cout << all_sharp << endl;
  } else {
    cout << all_dot << endl;
  }
}
