#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  bool flag = true;
  int c = 0;
  while (flag && c < N) {
    if (S[c] == '#') {
      flag = false;
    }
    c++;
  }
  if (flag) {
    cout << 0 << '\n';
  } else {
    int counter = 0;
    for (int i = c; i < N; i++) {
      if (S[i] == '.') {
        counter++;
      }
    }
    cout << counter << '\n';
  }
}
