
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <stack>
#include <queue>
#include <cctype>
#include <complex>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <cassert>
#include <iomanip>

using namespace std;

#define dump(x)  cout << " "<< #x << " = " << (x) << endl;
#define pb push_back
typedef long long ll;
typedef complex<int> P;
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int INF = 1e+6;


struct st{
	int a, b;
	int d;
	st(){}
};


int prim(vector<bool>& used, vector<int>& mincost, vector<vector<int> >& cost, int V){
	for(int i=0;i<V;i++){
		mincost[i] = INF;
		used[i] = false;
	}
	mincost[0] = 0;
	int res = 0;
	while(true){
		int v = -1;
		for(int u=0;u<V;u++){
			if(!used[u] && (v == -1 || mincost[u] < mincost[v])) v = u;
		}
		if(v == -1) break;
		used[v] = true;
		res += mincost[v];
		for(int u=0;u<V;u++){
			mincost[u] = min(mincost[u], cost[u][v]);
		}
	}
	return res;
}

bool solve(){
	int n;
	cin>> n;
	if(!n) return false;
	
	int m;
	cin>> m;
	vector<st> vst(m);
	for(int i=0;i<m;i++){
		char c1, c2;
		cin>> vst[i].a>> c1>> vst[i].b>> c2>> vst[i].d;
		vst[i].d = vst[i].d/100 -1;
	}

	vector<bool> used(m, false);
	vector<int> mincost(n, INF);
	vector<vector<int> > cost(n, vector<int>(n, INF));
	for(int i=0;i<m;i++){
		int u = vst[i].a;
		int v = vst[i].b;
		int c = vst[i].d;
		cost[u][v] = c;
		cost[v][u] = c;
	}
	
	cout<< prim(used, mincost, cost, n)<< endl;
	return true;
}

int main(){
	cout.setf(ios::fixed);
	cout.precision(10);
	
	while(solve());
	return 0;
}

 