#include <iostream>
#include <iomanip>
// std::cout << std::setprecision(2) << 3.141; // "3.1"
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <map>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef pair<double, ll> pdlg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
typedef tuple<double, double, double> tddd;

static const int giga = pow(10,9);
// double pi = 3.141592653589793238463;
int n;
string input;

bool judge(int);

int main(void){
  cin >> n >> input;

  int ans = 0;
  for(int i = 1; i < n; i++){
    if(input[i-1] == '#' && input[i] == '.'){
      int left = 0;
      int right = 0;
      do{
	left++;
	if(input[i+1] == '.'){
	  right++;
	} else {
	  break;
	}
      } while(input[i-left] == '#' || input[i+right] == '.' || left == i || right == n-1-i);
    }
    
    int temp = min(left, right);
    ans += temp;
  }

  cout << ans << endl;
  
  return 0;
}