#!/usr/local/bin/perl

$linenum = 0;
while ($line = <STDIN>) {
        $linenum += 1;
        $occurs = 0;
        $line =~ tr/A-Z/a-z/;
        @words = split(/\s+/, $line);
        foreach $word (@words) {
                $occurs += 1 if ($word eq "the");
        }
        if ($occurs > 0) {
             print ("line $linenum: $occurs occurrences\n");
        }
}
