#include<iostream>
#include<climits>
using namespace std;

#define ROOT (-1)
#define INV (-1)
#define INFTY INT_MAX
#define MAX_NODES 100

int prim(int n, int dist[][MAX_NODES]){
	int ans = 0; // problem answer
	bool vis[MAX_NODES];
	int cost[MAX_NODES];
	int pi[MAX_NODES];

	for(int i = 0; i < n; i++){
		vis[i] = false;
		cost[i] = INFTY;
	}

	cost[0] = 0;
	pi[0] = ROOT;

	while( true ){
		int mincost = INFTY;
		int nmin;

		for(int i = 0; i < n; i++){
			if( !vis[i] && mincost > cost[i] ){
				mincost = cost[i];
				nmin = i;
			}
		}

		// end
		if( mincost == INFTY ) break;

		vis[nmin] = true;

		for(int i = 0; i < n; i++){
			if( vis[i] || dist[nmin][i] == INV ) continue; // skip
			if( dist[nmin][i] < cost[i] ){
				cost[i] = dist[nmin][i];
				pi[i] = nmin;
			}
		}
	}

	// calc
	for(int i = 1; i < n; i++){
		ans += ( (cost[i] == INFTY ? 100 : cost[i]) - 100) / 100;
	}
	return ans;
}

int main(void){
	while( true ){
		int dist[MAX_NODES][MAX_NODES];
		int n;
		int m;

		cin >> n;
		if( n == 0 ) break;
		cin >> m;
		
		// init
		for(int i = 0; i < sizeof(dist)/sizeof(*dist); i++){
			for(int j = 0; j < sizeof(dist[i])/sizeof(*dist[i]); j++){
				dist[ i ][ j ] = INV;
			}
		}

		// input
		for(int i = 0; i < m; i++){
			int a, b, d;
			char dum;
			cin >> a >> dum >> b >> dum >> d;
			dist[a][b] = d;
			dist[b][a] = d;
		}

		// prim algorithm
		cout << prim(n, dist) << endl;
	}
	return 0;
}