def n_ecp_elements(keywords, molecule):
    """Number of elements that require an ECP"""

    ecp_kwd = keywords.ecp

    if ecp_kwd is None:
        return 0

    ecp_elems = set(atom.label for atom in molecule.atoms
                    if atom.atomic_number >= ecp_kwd.min_atomic_number)

    return len(ecp_elems)