#include <iostream>
#include <algorithm>
#include <climits>

using namespace std;

const int size = 100;

int main() {
  while (true) {
    int n, m, w[size][size];
    cin >> n >> m;

    if (n == 0)
      break;

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

    int status[size] = { 1 };
    int sum = 0;

    for (int i = 0; i < n-1; ++i) {
      int mincost = INT_MAX;
      int as, bs;

      for (int a = 0; a < n; ++a) {
        for (int b = 0; b < n; ++b) {
          if (status[a] + status[b] == 1 && w[a][b] < mincost) {
            mincost = w[a][b];
            as = a;
            bs = b;
          }
        }
      }

      status[as] = status[bs] = 1;
      sum += (w[as][bs] - 100) / 100;
    }
    cout << sum << endl;
  }
}
