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