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