using System;
using System.Collections.Generic;
using System.Linq;
class M{static void Main(String[] _) {
  int N = int.Parse(Console.ReadLine());
  var S = Console.ReadLine();
  var s = S.ToCharArray();
  int r1 = 0;
  int r2 = 0;
  
  int T = S.Length;
  
  r1 = T;
  for( int I=0 ; I<T ; ++ I ) {
    if ( s[I] == '#' ) {
      r1 = I;
      break;
    }
  }  
	
  r2 = -1;
  for( int I=T-1 ; 0<=I ; -- I ) {
    if ( s[I] == '.' ) {
      r2 = I;
      break;
    }
  }
  
  
  int r3 = 0;
  for( int I=r1 ; I<=r2 ; ++I ) {
    if ( s[I] == '.' ) r3 ++;
  }
  
  if ( r2 - r1 > r3 ) {
    Console.WriteLine( r3 );
  } else {
    Console.WriteLine( r2 - r1 - r3 + 1 );
  }  
  
}
       
       
       
       
}