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