#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

const int MAX_N = 110;
const int MAX_E = 110*110;

int par[MAX_N];
int rnk[MAX_N];

void init(int n) {
	for (int i = 0; i < n; i++) {
		par[i] = i;
		rnk[i] = 0;
	}
}

int find(int x) {
	if (par[x] == x) {
		return x;
	} else {
		return par[x] = find(par[x]);
	}
}

void unite(int x, int y) {
	x = find(x);
	y = find(y);
	if (x == y) {
		return;
	}
	if (rnk[x] < rnk[y]) {
		par[x] = y;
	} else {
		par[y] = x;
		if (rnk[x] == rnk[y]) rnk[x]++;
	}
}

bool same(int x, int y) {
	return find(x) == find(y);
}

struct edge {
	int u, v, cost;
};

bool comp(const edge& e1, const edge& e2) {
	return e1.cost < e2.cost;
}

edge es[MAX_E];
int V, E;

int kruskal(void) {
	sort(es, es+E, comp);
	init(V);
	int res = 0;
	for (int i = 0; i < E; i++) {
		edge e = es[i];
		if (!same(e.u, e.v)) {
			unite(e.u, e.v);
			res += (e.cost-100)/100;
		}
	}
	return res;
}

int main() {
	int n, m;
	while (cin >> n) {
		if (n == 0) {
			break;
		}
		cin >> m;
		V = n;
		E = m;
		int a, b, c;
		char cc;
		for (int i = 0; i < m; i++) {
			cin >> a >> cc >> b >> cc >> c;
			es[i].u = a;
			es[i].v = b;
			es[i].cost = c;
		}
		cout << kruskal() << endl;
	}
}