#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int sum = 0;
  int flag = 0;
  for (int i = 0; i < n; i++) {
    if (s.at(i) == '#') {
      flag = 1;
    } else if (flag == 1 && s.at(i) == '.') {
      flag = 0;
      sum++;
    }
  }
  cout << sum << endl;
}
