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