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