while(n=gets.to_i)>0
l=(1..n).map{{}}
gets.to_i.times{a,b,c=eval"[#{gets}]";;l[a][b]=l[b][a]=c/100-1}
o=[0]
m=(1..n-1).to_a
d=[0]*n
while m!=[]
a=m.shift
(b=l[a].values_at(*o).compact.min)?
((o-[l[a].key(b)]).map{|i|l[a][i]&&d[i]>l[a][i]&&d[i]=l[a][i]};d[a]=b;o<<a):
m<<a
end
p d.inject:+
end