#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <list>
#include <iostream>
#include <climits>
#include <cfloat>

using namespace std;

typedef pair<int, int> edge;

int main()
{
	while (true)
	{
		int n, m;
		scanf("%d", &n);
		if (n == 0)
			break;

		vector<edge> edges[100];
		bool inTree[100];
		fill(inTree, inTree+100, false);

		scanf("%d", &m);
		for (int i = 0; i < m; ++i)
		{
			int a, b, c;
			scanf("%d,%d,%d", &a, &b, &c);
			edges[a].push_back(edge(c, b));
			edges[b].push_back(edge(c, a));
		}

		int res = 0;

		priority_queue<int, vector<edge>, greater<edge> > q;
		inTree[0] = true;
		for (int i = 0; i < edges[0].size(); ++i)
			q.push(edges[0][i]);

		while (!q.empty())
		{
			edge e = q.top();
			q.pop();
			if (inTree[e.second])
				continue;

			inTree[e.second] = true;
			res += e.first / 100 - 1;
			for (int i = 0; i < edges[e.second].size(); ++i)
				q.push(edges[e.second][i]);
		}

		printf("%d\n", res);
	}

	return 0;
}