#include<stdio.h>

int max(int a,int b){
  if(a>b) return b;
  return ;
}
 
int main(void){
  int n,i;
  int tmp,answer;
  scanf("%d",&n);
  
  char s[n];
  
  int a[n],b[n];
  
  for(i=0;i<n;i++){
    a[i]=0;
    b[i]=0;
  }
  
  scanf("%s",s);
  
  if(s[0]=='#') a[0]=1;
  if(s[n-1]=='.') b[n-1]=1;
  
  for(i=1;i<n;i++){
    if(s[i]=='#') 
      a[i]=a[i-1]+1;
    else a[i]=a[i-1];
    
    if(s[n-1-i]=='.')
      b[n-1-i]=b[n-i]+1;
    else b[n-1-i]=b[n-i];
  }
  
  for(i=0;i<n;i++) 
    answer=max(answer,a[i]+b[i]-1);
  
  printf("%d",answer);
  
  return 0;
}