#include <cstdio>
#include <vector>
#include <algorithm>
#include <cstring>
#include <string>
#include <cctype>
#include <sstream>
#include <cmath>
#include <climits>
#include <set>
#include <iostream>
#include <map>
#include <functional>
#include <cstdlib>
#include <numeric>
#include <queue>

using namespace std;

#define reep(i,f,n) for(int i=f; i<int(n); ++i)
#define rep(i,n) reep(i,0,n)

typedef vector<int> vi;
typedef pair<int, int> pii;

struct Edge {
	int src, dst, cost;
	Edge(int s, int d, int c) : src(s), dst(d), cost(c) {}
	Edge() {}
	bool operator<(const Edge& e)const {
		return cost > e.cost;
	}
};
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;

Edges prim(const Graph& g)
{
	Edges T;
	vector<int> visited(g.size(), 0);
	visited[0] = 1;

	priority_queue<Edge> Q;
	rep(i, g[0].size())
		Q.push(g[0][i]);

	while(!Q.empty()){
		Edge e = Q.top();
		Q.pop();
		if(visited[e.dst])
			continue;
		T.push_back(e);
		visited[e.dst] = 1;
		rep(i, g[e.dst].size()){
			if(!visited[g[e.dst][i].dst])
				Q.push(g[e.dst][i]);
		}
	}
	return T;
}

int main()
{
	int n, m;
	while(scanf("%d", &n), n){
		scanf("%d", &m);
		Graph g(n);
		rep(i, m){
			int a, b, d;
			scanf("%d,%d,%d", &a, &b, &d);
			g[a].push_back(Edge(a, b, d));
			g[b].push_back(Edge(b, a, d));
		}
		Edges t = prim(g);
		int ans = 0;
		rep(i, t.size())
			ans += t[i].cost / 100 - 1;
		printf("%d\n", ans);
	}

	return 0;
}