#include<iostream>
#include<stdio.h>
#include<vector>
#define INF 2147483647
using namespace std;

class Lantern{
public:
	bool vector_find(vector<int> v,int key){
		for(int i=0;i<v.size();i++){
			if(v[i]==key){return 1;}
		}
		return 0;
	}
	int Solve(int n, int roadlist[100][100] ){
		int ans=0,i,j;
		vector<int> V;
		V.push_back(0);
		while(V.size()!=n){
			int u,v,min=INF;
			for(i=0;i<V.size();i++){
				for(j=0;j<n;j++){
					if(!vector_find(V,j)){
						if(roadlist[i][j]<min){
							u=i,v=j;
							min=roadlist[i][j];
						}
					}
				}
			}
			ans+=min;
			V.push_back(v);
		}
		return ans;
	}

};



int main(){
	int n,m;
	int rlist[100][100];
	while(1){
		for(int i=0;i<100;i++){
			for(int j=0;j<100;j++){
				rlist[i][j]=INF;
			}
		}
		
		scanf("%d",&n);
		if(n==0){break;}
		scanf("%d",&m);
		for(int i=0;i<m;i++){
			int a,b,c;
			scanf("%d,%d,%d",&a,&b,&c);
			rlist[a][b]=rlist[b][a]=c/100-1;
		}
		Lantern lantern;
		printf("%d\n",lantern.Solve(n,rlist));
	}
	
	
	
}
	
	