#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int count = 0;
  bool isblack = s[0] == '#' ? true : false;
  for (int i = 1; i < n; i++) {
    if (isblack && (s[i] == '.')) count++;
    isblack = s[i] == '#' ? true : false;
  }
  cout << count << endl;
  return 0;
}
