while(<>) {
if($_ =~ /Subject: (Re: *)*(.*)/) {
$subject=$2;
$a{$subject}++;
}
print map {"$a{$_} $_\n"} keys %a}