#include <queue>
#include <vector>
#include <iostream>
#include <algorithm>
#define WHITE 0
#define GRAY 1
#define BLACK 2
#define INF 1000000000000000000LL
using namespace std;
long long prim(int V, vector<pair<long long, long long>> X[]) {
	queue<pair<long long, long long> > Q; long long dist[100], color[100];
	for (int i = 0; i < V; i++) { dist[i] = INF; color[i] = WHITE; }
	dist[0] = 0; color[0] = GRAY; Q.push(make_pair(0, 0));
	while (!Q.empty()) {
		pair<long long, long long>pa = Q.top(); Q.pop();
		long long a1 = pa.first, a2 = pa.second; color[a2] = BLACK;
		for (int i = 0; i < X[a2].size(); i++) {
			long long to = X[a2][i].first, leng = X[a2][i].second;
			if (dist[to] > leng && color[to] < BLACK) {
				dist[to] = leng; Q.push(make_pair(dist[to], to));
			}
		}
	}
	long long sum = 0; for (int i = 0; i < V; i++) { sum += dist[i]; }//0-indexed
	return sum;
}
int n, m, u, v, w; vector<pair<long long, long long> > g[100];
int main() {
	while(cin >> n >> m) {
		for(int i = 0; i < n; i++) g[i].clear();
		for(int i = 0; i < m; i++) {
			scanf("%d,%d,%d", u, v, w);
			g[u].push_back(make_pair(v, w / 100 - 1));
			g[v].push_back(make_pair(u, w / 100 - 1));
		}
		cout << prim(n, g) << endl;
	}
}