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