#include <iostream>
#include <string>
#include <sstream>
#include <stack>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <queue>
#include <bitset>

#define rep(i, n) for(int i = 0; i < (n); i++)
#define FOR(i, a, n) for(int i = (a); i < (n); i++)
#define MP make_pair
#define all(s) (s).begin(), (s).end()
#define rev(s) (s).rbegin(), (s).rend()
#define X first
#define Y second

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> P;

struct edge{
	int to;
	int cost;
	edge(int t, int c){to=t; cost=c;}
	bool operator<(const edge &r)const{
		return cost>r.cost;
	}
};

int main(){
	int n, m;
	while(cin >> n, n){
		cin >> m;

		vector<vector<edge> > G(n);
		rep(i, m){
			int cost, from, to;
			char c;
			cin >> from >> c >> to >> c >> cost;
			G[from].push_back(edge(to, cost));
			G[to].push_back(edge(from, cost));
		}

		priority_queue<edge> q;
		rep(i, G[0].size()){
			q.push(G[0][i]);
		}
		vector<int> v;
		v.push_back(0);

		int sum = 0;
		while(v.size() < G.size()){
			edge e = q.top();
			q.pop();
			if( find(all(v), e.to) != v.end()) continue;
			v.push_back(e.to);
			sum += e.cost/100-1;

			rep(i, G[e.to].size()){
				q.push(G[e.to][i]);
			}
		}
		cout << sum << endl;

	}


	return 0;
}