#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int main(){
  int n;
  string s;
  cin >> n;
  cin >> s;
  int zc[n]=0,fc[n]=0,tot[n]=0;
  int zi=0,fi=0;
  bool fl = false;
  for (int i=0; i < n; i++){
    if (s[i]=='#'){
      zi += 1;
      zn[i] = zi;
    }else{
      zn[i] = zi;
    }
  for (int i = n-1; i >= 0; i--){
    if (s[i]=='.'){
      fi += 1;
      fn[i] = fi;
    }else{
      fn[i] = fi;
    }
  }
  tot = fn + zn;
  
  cout << min(tot);
}
