def n_lexemes_for_lemma(conn, language_code, lemma) -> int:
    """Get the number of dictionary entries with ``lemma`` as headword.
    
    :param conn: The database connection for the dictionary.
    :param str language_code: ISO 639-3 language code of the language of interest.
    :param lemma: A dictionary that contains the keys ``graphic`` and
        ``phonetic``.

    :return: The number of entries in the dictionary that have the specified
        lemma as one of its headwords.

    """
    return next(conn.cursor().execute(
        'SELECT COUNT(DISTINCT entry_id) '
        '    FROM lemmas '
        '    WHERE language = ? AND graphic = ? AND phonetic = ?',
        (language_code, lemma['graphic'], lemma['phonetic'])))[0]