#include <bits/stdc++.h>
using ll = long long;
using namespace std;
constexpr int MOD = 1e9 + 7;
constexpr ll MOD_LL = ll(1e9) + 7;
int main(void) {
  int n;
  string s;
  cin >> n >> s;
  int ans = 0;
  for (int i = 0; i < n - 1; ++i) {
    if (s[i] == '#' && s[i + 1] == '.') {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
