#include<iostream>
#include<string>
#include<map>
#include<algorithm>
#include<vector>
using namespace std:

int main(){
  int N;
  string S;
  cin >> N >> S;
  int cnt=0;
  
  for (int i=0;i<N-1;i++){
    if (S[i]=='#' and S[i+1] == '.')cnt++;
  }
  cout << cnt << endl;
}
    