#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  int mode = 0;
  int A = 0;
  cin >> N;
  vector<char> S(N);
  for (int i = 0; i < N; i++) {
    cin >> S.at(i);
    if (mode > 0 && S.at(i) == '.') {
      A++;
    } else if (mode == 0 && S.at(i) == '#') {
      mode++;
    }
  }
  cout << A << endl;
}
