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