#include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstdlib>
#include <ctime>
using namespace std;
#define REP(i, j) for(int i = 0; i < (int)(j); ++i)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define P pair<int, int>
#define SORT(v) sort((v).begin(), (v).end())
#define REVERSE(v) reverse((v).begin(), (v).end())
const int INF = (1 << 30);

void setV(vector< vector<int> > &v){
  string str, tmp; cin >>str;
  vector<string> nums;
  stringstream ss(str);
  while(getline(ss, tmp, ',')) nums.push_back(tmp);
  int from = atoi(nums[0].c_str()), to = atoi(nums[1].c_str()), cost = atoi(nums[2].c_str());
  v[from][to] = cost;
  v[to][from] = cost;
}

int main() {
  int V, E; cin >>V >>E;
  vector< vector<int> > v(V, vector<int>(V, INF));
  REP(i, E) setV(v);

  priority_queue< P, vector<P>, greater<P> > open;
  open.push(P(100, 0));
  vector<int> closed(V, INF);

  int min_cost = 0;
  while(!open.empty()){
    P now = open.top();
    open.pop();

    if(closed[now.second] != INF) continue;
    closed[now.second] = now.first;
    min_cost += (now.first - 100) / 100;

    REP(i, V){
      if(closed[i] == INF && v[now.second][i] != INF){
        open.push(P(v[now.second][i], i));
      }
    }

  }
  cout <<min_cost <<endl;
  return 0;
}