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