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