#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  string s;
  cin >> n >> s;
  int ans = 0, cnt = 0;
  char x = '#';
  char mark[200];
  mark['#'] = '.', mark['.'] = '#';
  for (auto i : s) {
    if (i == x) {
      cnt++;
      x = mark[x];
    } else {
      x = '#';
      ans += cnt / 2;
      cnt = 0;
    }
  }
  cout << ans << endl;
}
