#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int ans = 0;
  bool check = false;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#' and check == false) {
      check = true;
    }
    if (check == true) {
      if (S[i] == '.') {
        ans++;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
