#include <bits/stdc++.h>
static const int N = 100100;
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  string s;
  cin >> n >> s;
  int fb = -1;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      fb = i;
      break;
    }
  }
  if (fb < 0) {
    cout << 0 << endl;
    return 0;
  }
  int cb = 0;
  for (int i = fb + 1; i < n; i++) {
    if (s[i] == '.') {
      cb++;
    }
  }
  cout << cb << endl;
  return 0;
}
