#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  char s[n];
  cin >> s;
  bool isCalculate = false;
  int result = 0;
  for (int i = 0; i < n; i++) {
    if (isCalculate) {
      if (s[i] == '.') {
        result += 1;
      }
    } else {
      if (s[i] == '#') {
        isCalculate = true;
      }
    }
  }
  cout << result << endl;
}
