map=10.times.map{
        Array.new(10,0)
}
while buf=gets
        data=buf.chomp.split(",").map(&:to_i)
        arr=[[-1,0],[0,-1],[1,0],[0,1]]
        if data[2]==2
                arr+=[[-1,-1],[-1,1],[1,-1],[1,1]]
        end
         if data[2]==3
                arr+=[[-2,0],[-2,-2],[2,0],[0,2]]
        end
        arr.each{|i,j|
                map[data[0]+i][data[1]+j]+=1
        }
end
count = 0
map.flatten.each{|i|count+=1 if i==0}
puts count
print map.flatten.max