m=([0]*14).map{[0]*14}
while gets
x,y,t=$_.split(?,).map{|i|i.to_i+2}
m[x][y]+=1
m[x-1][y]+=1
m[x+1][y]+=1
m[x][y-1]+=1
m[x][y+1]+=1
[m[x-1][y-1]+=1,m[x-1][y+1]+=1,m[x+1][y-1]+=1,m[x+1][y+1]+=1]if t>3
[m[x-2][y]+=1,m[x+2][y]+=1,m[x][y-2]+=1,m[x][y+2]+=1]if t>4
end
n=m[2..11].flat_map{|i|i[2..11]}
p n.count(0),n.max