#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int a;
  char n[200000] = "";
  int ans = 0;
  cin >> a >> n;
  for (int i = 0; i < a; ++i) {
    if (n[i] == '#' && n[i + 1] == '.') {
      n[i + 1] = '#';
      ans++;
    }
  }
  cout << ans << endl;
}
