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