public int printSmiles(int smiles) {
        int result = 0;
        while (smiles != 1) {
            int sd = check(smiles);
            if (sd == smiles) return result + smiles;
            result += sd;
            smiles = smiles / sd;
        }
        return result;
    }