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