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