#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  string s;
  cin >> n >> s;

  int i, a = 0, counta = 0, b = 0, countb = 0;
  for(i = 0; i < s.size(); i++){
    if(s.at(i) == '#'){
    a = i
    break;
    }
  }

  for(i = a; i < s.size(); i++){
    if(s.at(i) == '.'){
    counta++;
    }
  }

  for(i = s.size() - 1; i >= 0; i--){
    if(s.at(i) == '.'){
    b = i
    break;
    }
  }

  for(i = b; i >= 0; i--){
    if(s.at(i) == '#'){
    countb++;
    }
  }

  int ans;
  ans = min(counta, countb)

  cout << ans << endl;
}
