$max =0; $s=<>; while($s=~/(…+)/g){ $len =length($&)/3; $max=$len if$max<$len; } print $max,$/;