#!/usr/bin/perl -n chomp; $A+=$_; if(eof){ print "$A\n";$A=0 };