until 0 == n = gets.to_i
	m = gets.to_i
	root = Array.new(n+1){Array.new(n+1){Float::INFINITY}}
	near = Hash.new() {|h,k|h[k]=[]}
	checked = [0]
	m.times do
		a,b,c = gets.split(",").map(&:to_i)
		root[a][b] = c
		root[b][a] = c
	end
	root[0].each_with_index do |val,idx|
		unless val==nil
			near[val].push idx
		end
	end
	sum = 0
	until near.empty?
		min = near.min
		checked << min[1][0]
		root[min[1][0]].each_with_index do |val,idx|
			unless val==nil
				near[val].push idx
			end
		end
		sum += min[0]/100 - 1
		near = near.map { |k,v| [k,v-checked] }.to_h.select {|k,v| ! v.empty?}
	end
	puts sum
end