#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>
#include<stack>

using namespace std;

typedef long long Int;
typedef vector<int> vint;
typedef pair<int,int> pint;
#define mp make_pair

template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; }
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }
int in() { int x; scanf("%d", &x); return x; }

int way[110][110];
bool used[110];
int main() {
	int n,m;
	while(n=in()){
		m=in();
		int i,j;
		for(i=0;i<110;i++){
			for(j=0;j<110;j++){
				way[i][j]=1000000000;
			}
			way[i][i]=0;
		}
		for(i=0;i<m;i++){
			int a,b,d;
			scanf("%d,%d,%d",&a,&b,&d);
			chmin(way[a][b],d/100-1);
			chmin(way[b][a],d/100-1);
		}
		/*for(i=0;i<n;i++){
			for(j=0;j<n;j++){
				cout<<way[i][j]<<" ";
			}
			cout<<endl;
		}
		*/
		for(i=0;i<110;i++){
			used[i]=false;
		}
		priority_queue<pint,vector<pint>,greater<pint> > que;
		int res=0;
		que.push(pint(0,0));
		while(!que.empty()){
			pint p=que.top();
			que.pop();
			int v=p.second;
			if(used[v])continue;
			res+=p.first;
			used[v]=true;
//cout<<"v:"<<v<<endl;
			for(i=0;i<n;i++){
				if(way[v][i]!=1000000000&&v!=i&&!used[i]){
					que.push(pint(way[v][i],i));
//cout<<"i:"<<i<<endl;
				}
			}
		}
		cout<<res<<endl;
	}
	return 0;
}