#!/usr/bin/perl use Encode; use utf8; $count = 0; $tmpcount = 0; $temp =0; $i = 1; binmode STDIN, ':encoding(utf8)'; #binmode STDOUT, ':encoding(cp932)'; #binmode STDERR, ':encoding(CP932)'; while () { my $text = $_; my @te = split(//, $text); foreach my $tepart(@te) { if ($tepart eq "…") { if (($tmpcount+1) eq $temp) { $count++; } else { if ($count > 0) { $ans[$i] = $count; $i++; } $count = 1; } $tmpcount = $temp; } $temp++; } $ans[$i] = $count; if ($i eq 1) { print "$count\n"; } elsif ($i eq 2) { if ($ans[1] <= $ans[2]) { print "$ans[2]\n"; } else { print "$ans[1]\n"; } } }