#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int N;
  cin >> N;
  char S[N];
  for (int i = 0; i < N; i++) {
    cin >> S[i];
  }
  long long int bc = 0, wc = 0;
  bool bf = false;
  for (long long int i = 0; i < N; i++) {
    if (bf) {
      if (S[i] == '.') {
        bc++;
      }
    } else {
      if (S[i] == '#') {
        bf = true;
      }
    }
  }
  for (long long int i = 0; i < N - 1; i++) {
    if (S[i] == '#') {
      wc++;
    }
  }
  if (bc > wc) {
    cout << wc << endl;
  } else {
    cout << bc << endl;
  }
  return 0;
}
