Signal.trap(:INT){
  exit(0)
}

def small(x,y,area)
	if(y >= 1)
		area[x][y-1] += 1
	end
	if(x >= 1)	
		area[x-1][y] += 1
	end

	area[x][y] += 1
	
	if(x <= 8)
		area[x+1][y] += 1
	end
	if(y <= 8)
		area[x][y+1] += 1
 	end
	return area
end

def middle(x,y,area)
	if(y >= 1)
		if(x >= 1)
		area[x-1][y-1] += 1
		end

		area[x][y-1] += 1

		if(x <= 8)
		area[x+1][y-1] += 1
		end
	end

	if(x >= 1)
		area[x-1][y] += 1
	end
	area[x][y] += 1
	if(x <= 8)
	area[x+1][y] += 1
	end

	if(y <= 8)
		if(x >= 1)
		area[x-1][y+1] += 1
		end

		area[x][y+1] += 1

		if(x <= 8)
		area[x+1][y+1] += 1
		end
	end
	return area
end

def large(x,y,area)
	if (y >= 2)
		area[x][y-2] += 1
	end
	if (y <= 7)
		area[x][y+2] += 1
	end
	if (x >= 2)
		area[x-2][y] += 1
	end
	if (x <= 7)
		area[x+2][y] += 1
	end

	middle(x,y,area)

	return area
end

area = Array.new(10).map{Array.new(10,0)}
	
while where = gets

	spl = where.split(",")
	x = spl[0].to_i
	y = spl[1].to_i
	size = spl[2].to_i
	if (size == 1)
		area = small(x,y,area)
	elsif (size == 2)
		area = middle(x,y,area)
	elsif (size == 3)
		area = large(x,y,area)
	end

end

# search
max = 0
spaces = 0

10.times do |i|
	10.times do |j|
		if max < area[i][j] 
			max = area [i][j]
		end
		if area[i][j] == 0
			spaces += 1
		end
		#print area[i][j]
	end
	#print "\n"
end 

puts spaces
puts max