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