#include<cstdio>
#include<queue>
#include<algorithm>
using namespace std;

class street{
public:
  int a,b,d;
  void set(int x,int y,int z){a = x;b = y;d = z;};
  bool operator<(const street x)const{return d>x.d;}
};

int main(){
  int n,m;

  while(scanf("%d",&n) && n){
    scanf("%d",&m);
    priority_queue<street> q;
    for(int i=0;i<m;i++){
      int x,y,z;
      scanf("%d%*c%d%*c%d ",&x,&y,&z);
      q.push((street){x,y,z/100-1});
    }
    

    bool visit[100];
    for(int i=0;i<n;i++)visit[i] = false;
    
    int ans = 0;

    while(q.size()){
      street s = q.top();q.pop();
      if(!visit[s.a] || !visit[s.b]){
	ans += s.d;
	visit[s.a] = visit[s.b] = true;
      }
    }
    printf("%d\n",ans);
  }
}