class Dropping
  def initialize
    @drops = []
    @max = 0
    @count = 0
    @grid = Array.new(10).map{Array.new(10,0)}
    while input = $stdin.gets do
      x,y,s = input.chomp.split(',').map(&:to_i)
      case s
      when 1
        small_drop(x,y)
      when 2
        middle_drop(x,y)
      when 3
        large_drop(x,y)
      end
    end

    @grid.each do |line|
      @count += line.count(0)
      @max = [@max, line.max].max
    end

    puts @count
    puts @max
  end

  def small_drop(x,y)
    @grid[y][x] += 1 if checker(x,y)
    @grid[y-1][x] += 1 if checker(x,y-1)
    @grid[y+1][x] += 1 if checker(x,y+1)
    @grid[y][x-1] += 1 if checker(x-1,y)
    @grid[y][x+1] += 1 if checker(x+1,y)
  end

  def middle_drop(x,y)
    @grid[y-1][x-1] += 1 if checker(x-1,y-1)
    @grid[y-1][x] += 1 if checker(x,y-1)
    @grid[y-1][x+1] += 1 if checker(x+1,y-1)
    @grid[y][x-1] += 1 if checker(x-1,y)
    @grid[y][x] += 1 if checker(x,y)
    @grid[y][x+1] += 1 if checker(x+1,y)
    @grid[y+1][x-1] += 1 if checker(x-1,y+1)
    @grid[y+1][x] += 1 if checker(x,y+1)
    @grid[y+1][x+1] += 1 if checker(x+1,y+1)
  end

  def large_drop(x,y)
    @grid[y-1][x-1] += 1 if checker(x-1,y-1)
    @grid[y-1][x] += 1 if checker(x,y-1)
    @grid[y-1][x+1] += 1 if checker(x+1,y-1)
    @grid[y][x-1] += 1 if checker(x-1,y)
    @grid[y][x] += 1 if checker(x,y)
    @grid[y][x+1] += 1 if checker(x+1,y)
    @grid[y+1][x-1] += 1 if checker(x-1,y+1)
    @grid[y+1][x] += 1 if checker(x,y+1)
    @grid[y+1][x+1] += 1 if checker(x+1,y+1)
    @grid[y-1][x-1] += 1 if checker(x-1,y)

    @grid[y+2][x] += 1 if checker(x,y+2)
    @grid[y-2][x] += 1 if checker(x,y-2)
    @grid[y][x-2] += 1 if checker(x-2,y)
    @grid[y][x+2] += 1 if checker(x+2,y)
  end

  def checker(x, y)
    0 <= x && x < 10 && 0 <= y && y < 10
  end
end

d = Dropping.new