from typing import List


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