#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int bc = 0, wc = 0;
  for (int i = 0; i < N - 1; i++) {
    if (S[i] == '#') {
      for (int j = i + 1; j < N; j++) {
        if (S[j] == '#') break;
        bc++;
      }
    }
  }
  for (int i = N - 1; i >= 1; i--) {
    if (S[i] == '.') {
      for (int j = i - 1; j >= 0; j--) {
        if (S[j] == '.') break;
        wc++;
      }
    }
  }
  cout << min(bc, wc) << endl;
  return 0;
}
