#include <stdio.h>
int main(void){
  int i,n;
  scanf("%d",&n);
  int x=n;
  char s[n];
  char ss[n+1]={};
  char sss[n+1]={};
  scanf("%s",s);

  for(i=0;i<n;i++){
    if(s[i]=='#'){
      ss[i+1]=ss[i]+1;
      sss[i+1]=sss[i];
    }else{
      ss[i+1]=ss[i];
      sss[i+1]=sss[i]+1;
    }
  }
  
  

  for(i=0;i<=n;i++){
    if(x>ss[i]+sss[n]-sss[i]){
      x=ss[i]+sss[n]-sss[i];
    }
  }

  printf("%d",x);

  
  return 0;
  
}
