#include<iostream>
#include<cmath>
using namespace std;

int main(void){
  int n;
  string s;
  cin >> n >> s;
  int n_b = 0;
  int n_all_b = 0;
  for( int i=0; i<n; ++i){
    if( s[i] == '#') n_all_b++;
  }
  int  ans = n - n_all_b;
  for( int i=0; i<n; ++i){
    if( s[i] == '#') n_b++;
    ans = min(n_b + ( (n - (i+1)) - (n_all_b - n_b) ), ans);
  }
  cout << ans << endl;
  return 0;
}