#include<iostream>
using namespace std;
static const int INFTY = (1 << 21);
static const int MAX = 100;				//史跡の数
static const int WHITE = 0;
static const int GRAY = 1;
static const int BLACK = 2;				

int n, M[MAX][MAX];

int prim() {
	int d[MAX], p[MAX], vmin, u, color[MAX];
	for (int i = 0; i < n; i++) {
		d[i] = INFTY;
		p[i] = -1;
		color[i] = WHITE;
	}
	d[0] = 0;
	while (true) {
		vmin = INFTY;
		u = -1;
		for (int i = 0; i < n; i++) {
			if (d[i] < vmin && color[i] != BLACK) {
				vmin = d[i];
				u = i;
			}
		}
		if (u == -1) {
			break;
		}
		color[u] = BLACK;
		for (int v = 0; v < n; v++) {
			if (M[u][v] != INFTY && color[v] != BLACK) {
				if (M[u][v] < d[v]) {
					d[v] = M[u][v];
					p[v] = u;
					color[v] = GRAY;
				}

			}
		}
	}
	int sum = 0;
	for (int i = 0; i < n; i++) {
		if (p[i] != -1) {
			sum += M[i][p[i]];
		}
	}
	return sum;
}


int main() {
	int m;
	while (true) {
		cin >> n;
		if (n == 0) {
			break;
		}
		cin >> m;

		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				M[i][j] = INFTY;
			}
		}

		for (int i = 0; i < m; i++) {
			int a, b, c;
			char d, e;
			cin >> a >> d >> b >> e >> c;
			M[a][b] = c / 100 - 1;
			M[b][a] = c / 100 - 1;
		}

		cout << prim() << endl;
	}
	return 0;

}
