#!/afs/athena/contrib/perl/perl

while (<>) {
    s/^\s+//;
    ($word, $count) = split (/\s+/, $_);
    if ($word eq $oldword) {
	$oldcount += $count;
    }
    else {
	if ($oldword) {
	    printf "%20s %d\n", $oldword, $oldcount;
	}
	$oldcount = $count;
    }
    $oldword = $word;
}

if ($oldword) {
    printf "%20s %d\n", $oldword, $oldcount;
}
