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