#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int cnt = 0;
  bool cnt_start = false;
  for (int i = 0; i < n; i++) {
    if (cnt_start) {
      if (s[i] == '.') {
        cnt++;
      }
    } else if (s[i] == '#') {
      cnt_start = true;
    }
  }
  cout << cnt << endl;
}
