#include<iostream>
#include<string>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(n) rep(i,n)

const int maxn = 101,maxm = 5500;
#define inf 10000

int cost[maxn][maxn]={};
int mincost[maxn] = {};
bool used[maxn] = {};
int n,m,a,b,temp;
char t;

int main()
{
	while(cin >> n && n)
	{
		cin >> m;
		memset(cost, inf, sizeof(cost));
		memset(mincost, inf, sizeof(int)*maxn);
		memset(used, false, sizeof(used));
		mincost[0] = 0;
		
		int ans = 0;
		REP(m)
		{
			cin >> a >> t >> b >> t >> temp;
			cost[a][b] = (temp/100)-1;
			cost[b][a] = cost[a][b];
			//cout << a << "to" << b << " " << cost[b][a]<< endl;
		}
		
		while(1)
		{
			int minv = inf;
			rep(i,n)if(!used[i] &&(mincost[minv] == inf ||mincost[i] < mincost[minv])) minv = i;
			if(minv == inf) break;

			used[minv] = true;
			ans += mincost[minv];
			//cout << minv << ":"<< mincost[minv] << endl;

			REP(n) mincost[i] = min(mincost[i], cost[minv][i]);
		}
		cout << ans << endl;

	}

	return 0;
}