#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  char S[200010];
  cin >> N;
  cin >> S;
  char black = '#';
  char white = '.';
  int res = 0;
  for (int i = 1; i < N; i++) {
    if (S[i] == white && S[i - 1] == black) {
      S[i] = black;
      res++;
    }
  }
  cout << res << "\n";
}
