
    Write a function to determine the number of patients whose appointment attendance patterns matched across their historical record, predicted behavior, and actual attendance outcome. The function should compare three lists containing attendance data (historical, predicted, and actual) and count only the cases where all three values align at the same position. The count will help identify how many patients demonstrated consistent attendance behavior that was also correctly predicted by the demographic model.
    

    
def count_samepair(list1, list2, list3):
    """
    Write a function to determine the number of patients whose appointment attendance patterns matched across their historical record, predicted behavior, and actual attendance outcome. The function should compare three lists containing attendance data (historical, predicted, and actual) and count only the cases where all three values align at the same position. The count will help identify how many patients demonstrated consistent attendance behavior that was also correctly predicted by the demographic model.
    

    """
def count_samepair(list1, list2, list3):
    """
    Write a function to determine the number of patients whose appointment attendance patterns matched across their historical record, predicted behavior, and actual attendance outcome. The function should compare three lists containing attendance data (historical, predicted, and actual) and count only the cases where all three values align at the same position. The count will help identify how many patients demonstrated consistent attendance behavior that was also correctly predicted by the demographic model.
    

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