#include <iostream>
#include <vector>
#include <queue>

using namespace std;

struct UnionFind {
	vector<int> par;
	vector<int> tree_size;

	UnionFind(int n) {
		par.resize(n);
		tree_size.resize(n);
		for (int i = 0; i < n; i++) {
			par[i] = i;
			tree_size[i] = 1;
		}
	}

	//??¨???????????????
	int find(int x) {
		if (par[x] == x) return x;
		return par[x] = find(par[x]);
	}

	//????????¨????±????????????????
	bool same(int a, int b) {
		return find(a) == find(b);
	}

	//a???????????¨??¨b???????????¨?????????
	void marge(int a, int b) {
		if (same(a, b)) return;

		tree_size[find(a)] += tree_size[find(b)];
		par[find(b)] = par[find(a)];
	}

	void show_info() {
		for (int i = 0; i < par.size(); i++) {
			cout << par[i] << "," << tree_size[i] << endl;
		}
		cout << endl;
	}

	//a???????????¨?????§??????
	int size(int a) {
		return tree_size[find(a)];
	}


};

auto comp = [](pair<pair<int, int>, int > a, pair<pair<int, int>, int > b) {return a.second > b.second; };
priority_queue<pair<pair<int, int>, int>, vector<pair<pair<int, int>, int> >, decltype(comp) > que(comp);
int N;
int kraskal() {
	int sum = 0;
	UnionFind tree = UnionFind(N);

	for (; tree.size(0) != N;) {
		//tree.show_info();
		while (tree.same(que.top().first.first, que.top().first.second))
			que.pop();

		tree.marge(que.top().first.first, que.top().first.second);
		sum += que.top().second;
	}

	return sum;
}

void q72() {
	int m;
	for (; cin >> N >> m;) {
		for (; !que.empty();) que.pop();

		for (int i = 0; i < m; i++) {
			int s, t, c;
			char tmp;
			cin >> s >> tmp >> t >> tmp >> c;
			que.push(make_pair(make_pair(s, t), c));
		}
		cout << kraskal() / 100 - N + 1 << endl;
	}
}

int main() {
	q72();
	return 0;
}