#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long N;
  string S;
  cin >> N >> S;
  int index = -1;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      index = i;
      break;
    }
  }
  int count = 0;
  if (index >= 0) {
    for (int k = index; k < N; k++) {
      if (S[k] == '.') count++;
    }
  }
  index = -1;
  for (int i = S.size() - 1; i >= 0; i--) {
    if (S[i] == '.') {
      index = i;
      break;
    }
  }
  int count2 = 0;
  if (index >= 0) {
    for (int k = index; k >= 0; k--) {
      if (S[k] == '#') count2++;
    }
  }
  cout << min(count, count2) << endl;
}
