factor | awk '{\
    N=split($0,A);
    for(i=2;i<=N;i++)D[A[i]]++;
    ans = 0
    for(i in D){
        k = 1
        while(1){
            D[i]-=k++
            if(D[i]<0)break;
            else ans++;
        }
    }
    print ans
}'
