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