#include<cstdio.txt>
#include<cctype>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<stack>
#include<queue>
#include<deque>
#include<vector>
#include<list>
#include<bitset>
#include<set>

using namespace std;

#define MAX_N 100
#define INF 1 << 20

int n, m, a, b, c, d[MAX_N][MAX_N], i, j, min[3], cnt, ans;
bool array[MAX_N];

int main(){
	while (true){
		scanf("%d", &n);
		if (n == 0) return 0;
		scanf("%d", &m);
		cnt = 1;
		ans = 0;
		for (i = 0; i < n; i++){
			for (j = 0; j < n; j++){
				if (i == j){
					d[i][j] = 0;
					continue;
				}
				d[i][j] = INF;
			}
			array[i] = false;
		}
		array[0] = true;
		for (i = 0; i < m; i++){
			scanf("%d,%d,%d", &a, &b, &c);
			d[a][b] = c / 100 - 1;
			d[b][a] = c / 100 - 1;
		}
		for (cnt = 1; cnt < n; cnt++){
			c = INF;
			for (i = 0; i < n; i++){
				for (j = 0; j < n; j++){
					if (array[i] && !array[j] && c > d[i][j]){
						c = d[i][j];
						b = j;
					}
				}
			}
			ans += c;
			array[b] = true;
		}
		printf("%d\n", ans);
	}
}