#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a;
  string s;
  cin >> n >> s;
  bool can = true;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      a = i;
      can = false;
      break;
    }
  }
  if (can) {
    cout << 0 << endl;
    return 0;
  }
  int count = 0;
  for (int i = a; i < n; i++) {
    if (s[i] == '#') count++;
  }
  cout << n - a - count << endl;
  return 0;
}
