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