#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>
#include <fstream>
#include <bitset>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef complex<double> Point;

#define PI acos(-1.0)
#define EPS 1e-10
const ll INF = 1e9 + 7;
const ll MOD = 1e9 + 7;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
#define fi first
#define se second

int n, m;

struct edge{ int to; int cost; };
vector<edge> G[110];
int mincost[110];
int res = 0;
bool used[110];//?????????????±???????????????????

int prim(){
	for (int i = 0; i < n; i++){
		mincost[i] = INF;
		used[i] = false;
	}
	mincost[0] = 0;

	priority_queue<P, vector<P>, greater<P>> que;
	que.push(P(0, 0));

	//cout << '!' << que.size() << endl;
	while (que.size()){
		P p = que.top(); que.pop();
		int v = p.second;

		if (used[v])continue;

		used[v] = 1;

		for (int i = 0; i < G[v].size(); i++){
			edge e = G[v][i];
			if (used[e.to])continue;
			if (mincost[e.to] > e.cost){
				mincost[e.to] = e.cost;
				que.push(P(e.cost, e.to));
			}
		}
	}

	REP(i, n){
		//cout << mincost[i] << endl;
		res += mincost[i];
	}
	return res;
}

int main(){
	while (cin >> n&&n){
		cin >> m;
		REP(i, m){
			int a, b, c;
			char k;
			cin >> a >> k >> b >> k >> c;
			G[a].push_back({ b, c });
			G[b].push_back({ a, c });
		}
		prim();
		int ans = 0;
		FOR(i,1, n){
			ans += (mincost[i] / 100 - 1);
			//cout << ans << endl;
		}
		cout << ans << endl;
		REP(i, 110)G[i].clear();
	}
}