n = gets.to_i
m = gets.to_i
root = Array.new(n){Array.new(n)}
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
i = 0
sum = 0
while i < n-1
    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[min[0]] -= checked
    if near[min[0]].empty?
        near.delete(min[0])
    end
    i+=1
end
puts sum