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