#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <memory.h>
#include <cassert>
#include <limits>

using namespace std;


#define all(c) ((c).begin()), ((c).end())
#define debug(c) cerr << "> " << #c << " = " << (c) << endl;
#define iter(c) __typeof((c).begin())
#define present(c, e) ((c).find((e)) != (c).end())
#define cpresent(c, e) (find(all(c), (e)) != (c).end())
#define tr(i, c) for (iter(c) i = (c).begin(); i != (c).end(); i++)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, a, b) for (int i = (int)(a); i <= (int)(b); i++)

#define mp make_pair
#define fst first
#define snd second
#define pb push_back


const double EPS = 1e-10;


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


const int MAX_V = 110;
const int INF = 9999999;


typedef int w_t;
struct e_t { int from, to; w_t cost; };
bool operator>(const e_t & a, const e_t & b) { return a.cost > b.cost; };

pair<w_t, vector<e_t> > prim(int N, vector<e_t> adj[MAX_V]) {
	vector<e_t> es;
	priority_queue<e_t, vector<e_t>, greater<e_t> > que;
	que.push((e_t){-1, 0, 0});
	bool visited[MAX_V];
	memset(visited, 0, sizeof(visited));
	vector<e_t> tree;
	w_t wgh = 0;
	while (!que.empty()) {
		e_t e = que.top();
		que.pop();
		if (visited[e.to]) continue;
		visited[e.to] = true;
		if (e.from >= 0) {
			tree.pb(e);
			wgh += e.cost;
		}
		tr(i, adj[e.to]) que.push(*i);
	}
	
	return mp(wgh, tree);
}


int main() {
	for (int n, m; cin >> n, n != 0; ) {
		cin >> m;
		vector<e_t> adj[MAX_V];
		rep(i, m) {
			char c; int a, b, d; cin >> a >> c >> b >> c >> d;
			adj[a].pb((e_t){a, b, d});
			adj[b].pb((e_t){b, a, d});
		}
		vector<e_t> es = prim(n, adj).snd;
		int ans = 0;
		rep(i, es.size()) ans += es[i].cost / 100 - 1;
		cout << ans << endl;
	}
	return 0;
}