from typing import List


def count_failed_students(student_scores: List[int]) -> int:
    """
    :param student_scores: list of integer student scores.
    :return: integer count of student scores at or below 40.
    """

    return len(list(filter(lambda x: x <= 40, student_scores)))