#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
#define INF (1 << 21)

int main(){
  int n,m;
  int a,b,ab;
  int cost[101][101];
  int min_cost[101];
  bool used[101];
  while(1){
    cin >> n;
    if(n == 0) break;
    cin >> m;
    for(int i=0;i<101;i++){
      for(int j=0;j<101;j++){
	cost[i][j] = INF;
      }
    }
    for(int i=0;i<m;i++){
      scanf("%d,%d,%d",&a,&b,&ab);
      cost[a][b] = ab / 100 - 1;
      cost[b][a] = ab / 100 - 1;
    }
    for(int i=0;i<n;i++){
      min_cost[i] = INF;
      used[i] = false;
    }
    min_cost[0] = 0;
    int ans = 0;
    while(1){
      int v = -1;
      for(int i=0;i<n;i++){
	if(!used[i] && (v == -1 || min_cost[i] < min_cost[v])){
	  v = i;
	}
      }
      if(v == -1) break;
      used[v] = true;
      ans += min_cost[v];
      for(int i=0;i<n;i++){
	min_cost[i] = min(min_cost[i],cost[v][i]);
      }
    }
    cout << ans << endl;
  }
}