
    Write a function that identifies how many students maintain consistent risk levels across their first-semester performance, second-semester performance, and attendance records. The function should compare three lists of student metrics and count only the cases where a student shows identical risk indicators (high, medium, or low) in the same position across all three assessment periods.
    

    
def count_samepair(list1, list2, list3):
    """
    Write a function that identifies how many students maintain consistent risk levels across their first-semester performance, second-semester performance, and attendance records. The function should compare three lists of student metrics and count only the cases where a student shows identical risk indicators (high, medium, or low) in the same position across all three assessment periods.
    

    """
def count_samepair(list1, list2, list3):
    """
    Write a function that identifies how many students maintain consistent risk levels across their first-semester performance, second-semester performance, and attendance records. The function should compare three lists of student metrics and count only the cases where a student shows identical risk indicators (high, medium, or low) in the same position across all three assessment periods.
    

    """
    result = sum((m == n == o for (m, n, o) in zip(list1, list2, list3)))
    return result