#include <bits/stdc++.h>
using namespace std;
int n;
string s;
int main() {
  cin >> n >> s;
  int cnt = 0;
  int mem = n;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      if (cnt == 0) {
        mem = i;
      }
      cnt++;
    }
  }
  if (mem == n) {
    cout << 0 << endl;
    return 0;
  }
  cout << n - cnt - mem << endl;
}
