import scala.io.Source.stdin

object Main extends App {

    val line = stdin.getLines
    val (a,b,c) = line.foldLeft(0,0,0){ (s,t) =>
      t.split(",").map(_.toInt) match { case Array(x,y) => (s._1+x*y,s._2+y,s._3+1) }
    }
    println(a)
    println(Math.round(b.toDouble/c))
}