#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int ans = 0;
  for (int i = 1; i < N; ++i) {
    if (S[i - 1] == '#' and S[i] == '.') {
      ans++;
    }
  }
  cout << ans << endl;
}
