#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int n, a = 0, b = 0;
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    if (s.at(i) == '#') {
      a = i + 1;
      break;
    }
  }
  for (int i = a; i < n; i++) {
    if (s.at(i) == '.') {
      b++;
    }
  }
  if ((b == n) || (a == 1)) {
    cout << 0 << endl;
  } else {
    cout << b << endl;
  }
}
