perl -E '$r+=$_,$i++while($_=<>)ne"\n";say$r/($i||1)' -