#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  cin >> N;
  string s;
  cin >> s;
  int sta = 0, cn = 0;
  for (int i = int(0); i < int(N); i++) {
    if (s.at(i) == '#') sta = 1;
    if (s.at(i) == '.' && sta == 1) cn++;
  }
  cout << cn << endl;
}
