require "pp"
map = Array.new()
10.times do |i|
  map << Array.new(10,0)
end

while line = gets
  x,y,size  = line.split(",").map(&:to_i)  
  map[x][y] += 1
  map[x+1][y] += 1 if x < 9
  map[x-1][y] += 1 if x > 0
  map[x][y+1] += 1 if y < 9
  map[x][y-1] += 1 if y > 0
  next if size == 1
  map[x+1][y+1] += 1 if x < 9 && y < 9
  map[x+1][y-1] += 1 if x < 9 && y > 0
  map[x-1][y+1] += 1 if x > 0 && y < 9
  map[x-1][y-1] += 1 if x > 0 && y > 0
  next if size == 2
  map[x+2][y] += 1 if x < 8
  map[x-2][y] += 1 if x > 1
  map[x][y+2] += 1 if y < 8
  map[x][y-2] += 1 if y > 1
end
c = 0
deep = 0
map.each do |row|
  max = row.max
  deep = max if max > deep
  c += row.count(0)
end
puts c
puts deep