#include <bits/stdc++.h>
using namespace std;
using int64 = int64_t;
using pii = pair<int, int>;
using pll = pair<int64_t, int64_t>;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  string s;
  cin >> s;
  int cnt = 0;
  for (int i = 0; i < n - 1; ++i) {
    if (s[i] == '#' && s[i + 1] == '.') ++cnt;
  }
  cout << (cnt) << '\n';
  return 0;
}
