#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b) - 1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)

#define PB push_back
#define INF (1<<29)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define CLR(a) memset(a,0,sizeof(a))
const int dx[] = {-1,0,0,1},dy[] = {0,1,-1,0};

typedef long long int ll;

using namespace std;

vector<int> split(string s){
    vector<int> ret;
    s += ',';
    int x = -1;
    REP(i,s.size()){
	if(s[i] == ','){
	    ret.PB( stoi(s.substr(x+1,i-x-1)) );
	    x = i;
	}
    }
    return ret;
}

int main(){
    while(true){
	int n,m;
	int d[101][101];
	int dd[101];
	memset(d,-1,sizeof(d));
	memset(dd,-1,sizeof(dd));
	cin >> n;
	if(n == 0) break;
	cin >> m;
	vector< vector<int> > vec(n,vector<int>(0));
	REP(i,m){
	    string s;
	    cin >> s;
	    vector<int> sl = split(s);
	    vec[sl[0]].PB(sl[1]);
	    vec[sl[1]].PB(sl[0]);
	    d[sl[0]][sl[1]] = sl[2];
	    d[sl[1]][sl[0]] = sl[2];
	}
	int ans = 0;
	int count = 0;
	int t = 0;
	int v = 0;
	vector<bool> used(n,false);
	used[0] = true;
	priority_queue< pair<int,int>,vector< pair<int,int> >, greater< pair<int,int> > > q;
	REP(i,vec[0].size()){
	    q.push( pair<int,int>(d[0][vec[0][i]],vec[0][i]));
	}
	while(!q.empty()){
	    v = q.top().first;
	    t = q.top().second;
	    q.pop();
	    if(!used[t]){
		used[t] = true;
		dd[t] = v;
		ans += v/100 - 1;
		REP(i,vec[t].size()){
		    q.push( pair<int,int>(d[t][vec[t][i]],vec[t][i]));
		}
	    }else if(dd[t] > v){
	    }
	}
	REP(i,n){
	}
	cout << ans << endl;
    }
    return 0;
}