def drop(a,x,y)
  a[y][x] += 1 if x >= 0 and x < 10 and y >= 0 and y < 10
end

a = Array.new(10){Array.new(10, 0)}
while gets
  x,y,m = $_.split(",").map(&:to_i)
  case m
  when 1
    drop(a,x,y-1)
    drop(a,x-1,y);drop(a,x,y);drop(a,x+1,y)
    drop(a,x,y+1)
  when 2
    drop(a,x-1,y-1);drop(a,x,y-1);drop(a,x+1,y-1)
    drop(a,x-1,y);drop(a,x,y);drop(a,x+1,y)
    drop(a,x-1,y+1);drop(a,x,y+1);drop(a,x+1,y+1)
  when 3
    drop(a,x,y-2)
    drop(a,x-1,y-1);drop(a,x,y-1);drop(a,x+1,y-1)
    drop(a,x-2,y);drop(a,x-1,y);drop(a,x,y);drop(a,x+1,y);drop(a,x+2,y);
    drop(a,x-1,y+1);drop(a,x,y+1);drop(a,x+1,y+1)
    drop(a,x,y+2)
  end
end
puts "#{a.flatten.count(0)}\n#{a.flatten.max}"