#include <stdio.h>
#include <iostream>
#include <limits.h>
#include <cstdlib>
#include <algorithm>
#include <unordered_map>
#include <vector>
using namespace std;

int main(void){
  int a;
  char n[200000] = "";
  int ans = 0;
  cin >> a >> n;
  for(int i = 0; i < a ; ++i){
    if(n[i] == '#' && n[i+1] == '.'){
      if(n[i+2] == "."){
        n[i] = ".";
      }else{
        n[i+1] = '#';
      }
      ans++;
    }
  }
  cout << ans << endl;
}
