#include <iostream>
#include <vector>
#include <queue>

using namespace std;

typedef struct ST_edge {
	int a;
	int b;
	int d;
	ST_edge() { a=0; b=0; d=0; }
	ST_edge(int a_, int b_, int d_) { a=a_; b=b_; d=d_; }
	bool operator>(const ST_edge& e) const { return d > e.d; }
} edge;

int main()
{
	while (true) {
		int n, m;
		cin >> n;
		if (n==0) break;
		cin >> m;
		priority_queue< edge, vector<edge>, greater<edge> > E;
		int a_, b_, d_;
		char dummy;
		for (int i=0; i<m; i++) {
			cin >> a_ >> dummy >> b_ >> dummy >> d_;
			E.push( edge(a_, b_, d_) );
		}
		
		vector<int> comp;
		comp.reserve(n);
		for (int i=0; i<n; i++) comp.push_back(i);
		
		int num_of_lantern = 0;
		while ( !E.empty() ) {
			edge e = E.top();
			if (comp.at(e.a) != comp.at(e.b)) {
				comp.at(e.a) = comp.at(e.b);
				num_of_lantern += e.d/100 - 1;
			}
			E.pop();
		}
		
		cout << num_of_lantern << endl;
	}
	
	return 0;
}