#include <cstdio>
#include <queue>
#include <vector>
#include <utility>
#include <algorithm>
using namespace std;

typedef pair<int, int> P;

const int INF = 1000000000;

int route[100][100];
int n, m;

int min_cost();

int main()
{
	while (scanf("%d", &n) * n != 0){
		scanf("%d", &m);
		fill(&route[0][0], &route[99][99], INF);
		for (int i = 0; i < m; i++){
			int a, b, cost;
			
			scanf("%d,%d,%d", &a, &b, &cost);
			cost = cost / 100 - 1;
			route[a][b] = cost;
			route[b][a] = cost;
		}
		printf("%d\n", min_cost());
	}
	
	return 0;
}

int min_cost()
{
	priority_queue<P, vector<P>, greater<P> > prim_route;
	bool point[100] = {false};
	int sum = 0;
	
	prim_route.push(P(0, 0));
	while (!prim_route.empty()){
		pair<int, int> p = prim_route.top();
		prim_route.pop();
		int from = p.second;
		
		if (point[from]){
			continue;
		}
		point[p.second] = true;
		sum += p.first;
		for (int i = 0; i < n; i++){
			if (route[from][i] != INF){
				prim_route.push(P(route[from][i], i));
			}
		}
	}
	
	return sum;
}