import scala.io.StdIn.readLine

object Main {
  val paper = Array.ofDim[Int](10,10)
  def dropTo(x:Int,y:Int) = if(x>=0 && x<10 && y>=0 && y<10) paper(x)(y) += 1

  def drop(x:Int,y:Int,size:Int) = {
    dropTo(x,y)
    dropTo(x+1,y)
    dropTo(x-1,y)
    dropTo(x,y+1)
    dropTo(x,y-1)
    if(size == 2 || size == 3) {
      dropTo(x-1,y-1)
      dropTo(x-1,y+1)
      dropTo(x+1,y-1)
      dropTo(x+1,y+1)
      if(size == 3) {
        dropTo(x+2,y)
        dropTo(x-2,y)
        dropTo(x,y+2)
        dropTo(x,y-2)
      }
    }
  }

  def dropInk():Unit = {
    val r = readLine

    if(r==null)  {
      val x = paper.flatten
      println(x.count(_==0))
      println(x.max)
    }
    else {
      val d = r.split(",").map(_.toInt)
      drop(d(0),d(1),d(2))
      dropInk()
    }
  }

  def main(args:Array[String]) = dropInk()
}