#include <bits/stdc++.h>

#define INF INT_MAX
#define ll long long
#define REP(i,n) for(int i=0;i<n;i++)

using namespace std;

class Node{
public:
	int index;
	bool used;	//????°???¨?????¨????????????????????????
	vector< pair<Node*,int> > road;	//first:?????°???????????????second:?????°?????????????????????
};

int main(){
	cin.tie(0);
    ios::sync_with_stdio(false);

	int n,m;	//n:???????????°,m:??????????£?????????¶????????¬??°
	while(scanf("%d %d",&n,&m)  != EOF && n != 0){
		vector<Node> x;		//????°???¨?????¨(MST)
		vector<Node> t(n);	//??°????????¨???
		REP(i,n){t[i].index = i;t[i].used = false;}	//??????????????????????????£?????????
		int cost,a,b;
		REP(i,m){
			//cin >> a >> b >> cost;
			scanf("%d,%d,%d",&a,&b,&cost);
			t[a].road.push_back(make_pair(&t[b],cost));
			t[b].road.push_back(make_pair(&t[a],cost));
		}
		//???????????????????????????????????????a?????????MST???
		t[0].used = true;
		x.push_back(t[0]);
		//MST????????°?????¨?????????????????°n??????????????§??°?????????
		int ans = 0;
		while(x.size() < n){
			int min_cost = INF;
			Node* min_node;
			//?????¨???MST????????????MST??\???????????????????????°??????????°???????????????¨???????????¢???
			REP(i,x.size()){
				//?????????i???????????°????????¨??????????????????????°????????????????????????¢???
				REP(j,x[i].road.size()){
					if(x[i].road[j].first->used)continue;	//??????MST??????????????????????????´???
					if(min_cost > x[i].road[j].second){
						min_node = x[i].road[j].first;
						min_cost = x[i].road[j].second;
					}
				}
			}
			min_node->used = true;
			x.push_back(*min_node);	//????°???????????????¨???????????????????????????MST?????????
			ans += min_cost / 100 - 1;
		}
		cout << ans << endl;
		
	}

	return 0;
}