#include <iostream>
#include <map>
#include <algorithm>
#define INF 1<<27
#define MAX_N 201

using namespace std;
int mincost[MAX_N];
int n,m;
int cost[MAX_N][MAX_N];
bool used[MAX_N];
int prim()
{
  int res = 0;
  mincost[0] = 0;
  while(1)
    {
      int v = -1;
      for(int i = 0 ; i < n ; i++ ){
	while( !used[i] && (v == -1 || mincost[i] < mincost[v]))v = i;
      }
      if(v == -1)break;
      used[v] = true;
      res += mincost[v];

      for(int i = 0 ; i < n ; i++ )
	{
	  mincost[i] = min(mincost[i],cost[v][i]);
	}
    }
  return res;
}

int main()
{
  while(cin >> n >> m,n)
    {
      fill(cost[0],cost[MAX_N],INF);
      fill(used,used+MAX_N,false);
      fill(mincost,mincost+MAX_N,INF);
      for(int i = 0 ; i < m ; i++ )
	{
	  char c;
	  int a,b,d;
	  cin >> a >> c >> b>>c >> d;
	  cost[a][b] = cost[b][a] = (d-100)/100;
	}
      int res = prim();
      cout << res << endl;
    }
  return 0;
}