#include <iostream>
#include <vector>
#include <tuple>

// Union Find
template<class T=int>
class UnionFind
{
    std::vector<T> p;
    std::vector<T> r;
    T find(const T x)
    {
        if(x==p[x]) return x;
        return p[x]=find(p[x]);
    }
    void unite_(T x, T y)
    {
        if(x==y) return;
        if(r[x]>r[y]) std::swap(x,y);
        else if(r[x]==r[y]) ++r[y];
        p[x]=y;
    }
public:
    explicit UnionFind(const T n):p(n),r(n,0)
    {
        for(T i=0; i<n; ++i)
            p[i]=i;
    }
    bool same(const T x, const T y)
    {
        // assert(0<=x && x<p.size())
        // assert(0<=y && y<p.size())
        return find(x)==find(y);
    }
    void unite(const T x, const T y)
    {
        // assert(0<=x && x<p.size())
        // assert(0<=y && y<p.size())
        unite_(find(x),find(y));
    }
};

// Kruskal's algorithm
template<class T, class U>
T& kruskal(T& edges, U max_v)
{
    typedef typename T::value_type Edge;
    std::sort(edges.begin(),edges.end());
    UnionFind<U> uf(max_v);
    edges.erase(
        std::remove_if(edges.begin(),edges.end(),
            [&uf](const Edge& e){
                const auto& a = std::get<1>(e);
                const auto& b = std::get<2>(e);
                if(uf.same(a,b)) return true;
                uf.unite(a,b);
                return false;
            }),
        edges.end());
    return edges;
}

int main()
{
    std::cin.tie(0);
    std::ios_base::sync_with_stdio(false);
    for(int n,m; (std::cin >> n >> m) && n; )
    {
        typedef std::tuple<int,int,int> T;
        std::vector<T> edges(m);
        for(auto& v: edges)
        {
            int a,b,d; char c; std::cin >> a >> c >> b >> c >> d;
            v = T(d,a,b);
        }
        int c=0;
        for(auto& e: kruskal(edges, n))
            c+=std::get<0>(e)/100-1;
        std::cout << c << "\n";
    }
}