#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, f = 0, c = 0;
  string s;
  cin >> n >> s;
  for (i = 0; i < n; i++) {
    if (s[i] == '#') {
      f = 1;
    } else {
      if (f == 1) {
        c++;
      }
    }
  }
  cout << c;
  return 0;
}
