#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N;
  string S;
  cin >> N;
  cin >> S;
  int cnt = 0;
  int j = 0;
  while (S[N - 1 - j] == '#') {
    j++;
  }
  for (int i = 0; i < N - j; i++) {
    if (S[i] == '.') {
      cnt += 1;
    }
  }
  if (cnt > (N - j) / 2) {
    cnt = (N - j) - cnt;
  }
  printf("%d\n", cnt);
  return 0;
}
