#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  int count;
  int kuro;
  int siro;
  int j;
  int n;
  cin >> N;
  cin >> S;
  kuro = 0;
  for (int i = 0; i < N; i++) {
    if (S.at(i) == '#') {
      j = i;
      n = i;
      break;
    } else {
      cout << 0 << endl;
    }
  }
  while (j < N) {
    if (S.at(j) == '#') {
      kuro = kuro + 1;
      j++;
    }
  }
  siro = N - (n + kuro);
  if (kuro < siro) {
    cout << kuro << endl;
  } else {
    cout << siro << endl;
  }
}
