def repetition_checksum(ids):
    """Return checksum - No. of ids with doubled letters * No. with tripled."""
    doubles, triples = 0, 0
    for code in ids:
        no_doubles, no_triples = True, True
        for letter in set(code):
            count = code.count(letter)
            if count == 2 and no_doubles:
                doubles += 1
                no_doubles = False
            elif count == 3 and no_triples:
                triples += 1
                no_triples = False

            if not no_doubles and not no_triples:
                break

    return doubles * triples