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