def cummulative_length(fasta, keys):
    """Return the sum of the lengths represented by `keys`."""
    keys = set(keys)

    lengths = []
    for name, seq in fasta.records.items():
        if name in keys:
            lengths.append(len(seq))

    return sum(lengths)