#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ans = 0;
  string s;
  char m = '.';
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') {
      if (m == '#') {
        s[i] = '.';
        ans++;
      }
    }
    m = s[i];
  }
  cout << ans << endl;
}
