#include <bits/stdc++.h>
#include<stdio.h>
using namespace std;
#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) begin(a),end(a)
#define MS(m,v) memset(m,v,sizeof(m))
#define D10  fixed<<setprecision(10)
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> P;
typedef long long ll;
const ll INF = 114514810;
const ll MOD = 1000000007;
const double EPS = 1e-8;
const double PI = acos(-1.0);
struct edge
{
	int from, to, cost;
	bool operator < (const edge& e) const { return cost < e.cost; }
	bool operator >(const edge& e) const { return cost > e.cost; }
};
int dx[] = { -1, 0, 0, 1 }; int dy[] = { 0, -1, 1, 0 };
bool valid(int x, int y, int h, int w) { return (x >= 0 && y >= 0 && x < h&&y < w); }
///*************************************************************************************///
///*************************************************************************************///
///*************************************************************************************///

int V, E;
vector<vector<edge>> es;
bool used[10000];

pair<int, vector<edge>> prim()
{
	memset(used, false, sizeof(used));
	vector<edge> res;
	int sum = 0;

	priority_queue<edge, vector<edge>, greater<edge>> que;
	que.push(edge{ -1, 0, 0 });

	while (!que.empty())
	{
		edge e = que.top(); que.pop();
		if (used[e.to]) continue;
		if (e.from >= 0) res.push_back(e);
		sum += e.cost;
		used[e.to] = true;
		for (edge i : es[e.to])
		{
			if (!used[i.to]) que.push(i);
		}
	}
	return pair<int, vector<edge>>(sum, res);
}

int main()
{
	while (cin >> V >> E, V)
	{
		es.clear();
		es.resize(V);
		REP(i, E)
		{
			int a, b, c;
			scanf("%d,%d,%d", &a, &b, &c);
			es[a].push_back(edge{ a, b, c });
			es[b].push_back(edge{ b, a, c });
		}
		cout << prim().first / 100 - (V - 1) << endl;
	}
}