#include <bits/stdc++.h>
using namespace std;
int main(void) {
  string s;
  int n;
  cin >> n >> s;
  int i, f = -1, g = n;
  for (i = 0; i < n; i++) {
    if (s[i] == '#') {
      f = i;
      break;
    }
  }
  for (i = n - 1; i > 0; i--) {
    if (s[i] == '.') {
      g = i;
      break;
    }
  }
  int b = 0, w = 0;
  for (i = f; i < g + 1; i++) {
    if (s[i] == '.') {
      w++;
    } else {
      b++;
    }
  }
  if (f == -1 || f == g) {
    cout << "0" << endl;
  } else if (w < b) {
    cout << w << endl;
  } else {
    cout << b << endl;
  }
  return 0;
}
