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