while(n=gets.to_i)>0
r=0..u=n-1
l=r.map{{}}
gets.to_i.times{a,b,c=eval"[#{gets}]";l[a][b]=l[b][a]=c/100-1}
m=r.to_a-o=[s=0]
u.times{a,b=o.product(m).min_by{|i,j|l[i][j]||1e9};s+=l[a][b];m-=o+=[b]}
p s
end