p=Array.new(10){(0..9).map{0}}
ds=[0,1,2,4]

while input=gets
	x,y,size=input.chomp.split(",").map{|s| s.to_i}
	d=ds[size]
	10.times{|i|
		10.times{|j|
			if (x-i)**2+(y-j)**2<=d
				p[i][j]+=1
			end
		}
	}
end

pf=p.flatten
count=pf.select{|k| k==0}.length
max=pf.max
puts count,max
