#define _GLIBCXX_DEBUG

#include <bits/stdc++.h>

#include <vector>
#include <cassert>
#include <algorithm>

using namespace std;

class Prim {
#define MAX_V 101

private:
  const int INF = 1e9 + 10;
  struct Edge {
    int to, cost;
    Edge(int to, int cost): to(to), cost(cost) { }
  };

  int V;
  vector<Edge> G[MAX_V];
  int mincost[MAX_V];
  bool used[MAX_V];

public:

  Prim(int V): V(V) { 
    if (V >= MAX_V) {
      assert(false);
    }
  }

  void AddEdge(int from, int to, int cost) {
    G[from].push_back(Edge(to, cost));
  }

  int Solve() {
    for (int i = 0; i < V; i++) {
      mincost[i] = INF;
      used[i]    = false;
    }

    mincost[0] = 0;
    int res = 0;

    while (true) {
      int v = -1;
      for (int u = 0; u < V; u++) {
        if (!used[u] && (v == -1 || mincost[u] < mincost[v])) {
          v = u;
        }
      }
      if (v == -1) {
        break;
      }
      used[v] = true;
      res += mincost[v];

      for (auto &e : G[v]) {
        mincost[e.to] = min(mincost[e.to], e.cost);
      }
    }

    return res;
  }
};

int main() {
  while (true) {
    int n, m;
    cin >> n;
    if (n == 0) {
      break;
    }
    cin >> m;
    Prim prim(n);
    for (int i = 0; i < m; i++) {
      int a, b, d;
      char s;
      cin >> a >> s >> b >> s >> d;
      prim.AddEdge(a, b, d);
      prim.AddEdge(b, a, d);
    }
    cout << prim.Solve() / 100 - (n - 1) << endl;
  }

  return 0;
}