#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int cnt = 0;
  for (int i = 0; i < (int)(n - 1); i++) {
    if (s.substr(i, 2) == "#.") {
      s[i + 1] = '#';
      cnt++;
    }
  }
  cout << cnt << endl;
  return 0;
}
