#!/usr/bin/perl -w

######################################################################
##
## avg.pl
##
## Created 2002-04-22 by Lasse A Vartiainen <lav@iki.fi>
##
######################################################################

while(<>) {
    if(/(\d\d\d\d)\d*,([\.\d]*)/) {
	$year=$1;$amount=$2;
	$total{$year}{'count'}++;
	$total{$year}{'sum'}+=$amount;
    }
}
for $year (sort keys %total) {
    print "$year:".int($total{$year}{'sum'}/$total{$year}{'count'}+0.5)."\n";
}
