#include <iostream>
#include <vector>
#include <cstdlib>
#include <limits.h>
using namespace std;

struct place{
	int id;
	int weight;
};

const int unseen = -INT_MAX;

int update(vector<place>& vi, int k, int w){
	vector<place>::iterator iter = vi.begin();
	while(iter != vi.end() && (*iter).id != k) iter++;
	if(iter == vi.end()){
		place p;
		p.id = k;
		p.weight = w;
		vi.push_back(p);
		return 1;
	}else{
		if((*iter).weight == w){
			return 0;
		}else{
			if(w < (*iter).weight){
				(*iter).weight = w;
				return 1;
			}else return 0;
		}
	}
}

void swap(vector<place>& vp, int i, int j){
	place p;
	p.id = vp[i].id; p.weight = vp[i].weight;
	vp[i].id = vp[j].id; vp[i].weight = vp[j].weight;
	vp[j].id = p.id; vp[j].weight = p.weight;
}

place remove(vector<place>& vp){
	int min = 0;
	for(int i = 0; i < vp.size(); i++){
		if(vp[i].weight < vp[min].weight)
			min = i;
	}
	swap(vp, min, vp.size() - 1);
	place p = vp[vp.size() - 1];
	vp.pop_back();
	return p;
}

int visit(int route[100][100], int k, int n){
	int weight = 0;
	int val [100];
	for(int i = 0; i < 100; i++) val[i] = unseen;
	vector<place> vp;
	update(vp, k, -unseen);
	while(!vp.empty()){
		place p = remove(vp);
		k = p.id;
		val[k] =-val[k];
		if(val[k] == -unseen) val[k] = 0;
		weight += val[k];
		for(int i = 0; i < n; i++){
			if(route[k][i] != 0)
				if(val[i] < 0)
					if(update(vp, i, route[k][i]))
					{
						val[i] = -route[k][i];
					}
		}
	}
	return weight;
}

int main(){
	const int nmax = 100;
	int n;
	int m;
	int route[nmax][nmax];
	int a, b;
	int dis;
	char c;
	while(cin >> n){
		for(int i = 0;i < nmax; i++){
			for(int j = 0; j < nmax; j++){
				route[i][j] = 0;
			}
		}
		if(n == 0) break;
		cin >> m;
		for(int i = 0; i < m; i++){
			cin >> a >> c >> b >> c >> dis;
			dis = dis / 100 - 1;
			route[a][b] = dis;
			route[b][a] = dis;
		}
		cout << visit(route, 0, n) << endl;
	}
	return 0;
}