m=([0]*14).map{[0]*14}
while l=gets
x,y,t=l.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
if t>3
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>4
m[x-2][y]+=1
m[x+2][y]+=1
m[x][y-2]+=1
m[x][y+2]+=1
end
end
end
m=m[2..11].map{|i|i[2..11]}.flatten
p m.count(0),m.max