#include <iostream>
#define COST_MAX 1000000

using namespace std;

int main() {
  int n;
  int m;
  while(1) {
    cin >> n;
    if(n == 0) break;
    cin >> m;

    int dist[n][n];
    for(int i = 0; i < n; i++) {
      for(int j = 0; j < n; j++) {
	dist[i][j] = COST_MAX;
      }
    }

    for(int i = 0; i < m; i++) {
      int a, b, d;
      scanf("%d,%d,%d", &a, &b, &d);
      dist[a][b] = dist[b][a] = d;
    }

    int cost[n];
    bool visited[n];
    for(int i = 0; i < n; i++) {
      cost[i] = COST_MAX;
      visited[i] = false;
    }
    cost[0] = 0;
    int pre[n];

    while(1) {
      int min = COST_MAX;
      int p;
      for(int i = 0; i < n; i++) {
	if(!visited[i] && cost[i] < min) {
	  min = cost[i];
	  p = i;
	}
      }
      if(min == COST_MAX) break;

      visited[p] = true;
      for(int i = 0; i < n; i++) {
	if(!visited[i] && dist[i][p] < cost[i]) {
	  cost[i] = dist[i][p];
	  pre[i] = p;
	}
      }
    }
    int ans = 0;
    for(int i = 0; i < n; i++) {
      if(cost[i] == 0) continue;
      ans += cost[i] / 100 - 1;
    }
    cout << ans << endl;
  }
  return 0;
}