def count_failed_students(student_scores):
    """Count the number of failing students out of the group provided.

    :param student_scores: list - containing int student scores.
    :return: int - count of student scores at or below 40.
    """

    non_passing = 0
    for score in student_scores:
        if score <= 40:
            non_passing += 1
    return non_passing