#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>

using namespace std;

#define M 987654321

class Prim
{
public:
	void mst (vector <vector <int> >, vector<int> &, vector <bool> &, vector <int> &);
private:

};
void Prim::mst (vector <vector <int> > t, vector <int>& pi, vector <bool>& v, vector <int>& cost)
{
	int size = v.size();
	int i;

	do{
		int mincost = M;
		int u;

		// costªÅ¬ÆÈém[huðIð·é
		for (i = 0; i < size; ++i){
			if (!v[i] && cost[i] < mincost){
				mincost = cost[i];
				u = i;
			} // end if
		} // end for

		v[u] = true;
	
		for (i = 0; i < size; ++i){
			// Ü¾ÜÜêÄ¢È¢m[hÌRXgÌXV
			if (!v[i] && t[u][i] < cost[i] ){
				cost[i] = t[u][i];
				pi[i] = u;
			} // end if
		} // end for		 
		
	} while ((int)count (v.begin(), v.end(), true ) != size );// end while
}

int main()
{
	Prim prim;

//	cut here before submit 
//	freopen("testcase.cdl", "r", stdin);

	string str = "";
	int n,m;	// n: jÕÌÓ m: jÕðÔ¹Ì

	while (getline (cin, str ) ) {
		stringstream ssn(str);
		ssn >> n;
		if (n == 0){
			break;
		} // end if
		getline (cin, str );
		stringstream ssm(str);
		ssm >> m;

		int i;
		vector <vector <int> > table (n, vector <int> (n, M ) );
		for (i = 0; i < m; ++i){
			int from, to, dist;
			getline (cin, str );
				while (str.find(',') != string::npos ){
				str = str.replace(str.find(','), 1, " ");
			} // end while
			stringstream ss(str);
			ss >> from >> to >> dist;
			table[from][to] = dist;
			table[to][from] = dist;
		} // end for

		vector <bool> visit (n, false );
		vector <int> len (n, M );
		vector <int> path (n, -1);
		len[0] = 0;
		path[0] = -1;

		prim.mst (table, path, visit, len );

		int res = accumulate (len.begin(), len.end(), 0);
		
		map <int, int> edge;
		for (i = 0; i < n; ++i){
			int curr = i;
			while (path[curr] != -1 ){
				edge[curr] = path[curr];
				curr = path[curr];
			} // end while

		} // end for

		cout << (res/100 - edge.size() ) << endl;

	} // end while

	return 0;
}