INK = [
  [[0, 0, 0, 0, 0],
   [0, 0, 1, 0, 0],
   [0, 1, 1, 1, 0],
   [0, 0, 1, 0, 0],
   [0, 0, 0, 0, 0]],
  [[0, 0, 0, 0, 0],
   [0, 1, 1, 1, 0],
   [0, 1, 1, 1, 0],
   [0, 1, 1, 1, 0],
   [0, 0, 0, 0, 0]],
  [[0, 0, 1, 0, 0],
   [0, 1, 1, 1, 0],
   [1, 1, 1, 1, 1],
   [0, 1, 1, 1, 0],
   [0, 0, 1, 0, 0]]
]

d = Array.new(10).map{Array.new(10,0)}
while n = gets do
  x, y, size = n.split(",").map(&:to_i)
  5.times do |i|
    5.times do |j|
      if -1 < x + i - 2 && x + i - 2 < 10 && -1 < y + j - 2 && y + j - 2 < 10 then
        d[x+i-2][y+j-2] = (d[x+i-2][y+j-2].to_i + INK[size-1][i][j].to_i).to_i
      end
    end
  end
end
max = 0
zero = 0
10.times do |i|
  zero = zero + d[i].count(0)
  max = (d[i] << max).max
end
puts zero
puts max