<?php
  
  list($n, $m) = explode(' ', trim(fgets(STDIN)));


  for($i=0; $i<$n; $i++){
    $s = trim(fgets(STDIN));
    for($j=0; $j<$m; $j++){
      $w[$i][$j] = $s[$j];	
    }    
  }

  $max = 0;
  for($i=0; $i<$n; $i++){
    for($j=0; $j<$m; $j++){
      
      $px = $i;
      $py = $j;
      
      $c = 0;
      while(true){
        if ((isset($w[$px+1][$py]) && $w[$px+1][$py] == ".") && $i => $n/2){
          $px++;
          $c++;
        } else if ((isset($w[$px][$py+1]) && $w[$px][$py+1] == ".") && $i => $n/2){
          $py++;
          $c++;
        } else if ((isset($w[$px][$py-1]) && $w[$px][$py-1] == ".") && $i < $n/2){
          $py--;
          $c++;
        } else if ((isset($w[$px][$py-1]) && $w[$px][$py-1] == ".") && $i > $n/2){
          $py--;
          $c++;
        } else {
          break;
        }
      }  
      if ($c > $max) $max = $c;      
      
      
    }    
  }

  echo $max;


  
  
?>