def count_ones_fours_sevens_eights(signals_and_outputs: list) -> int:
    """
    Use length of output string to determine how many ones (2 segments), fours (4 segments), sevens (3 segments), and
    eights (seven segments) there are

    Args:
        signals_and_outputs (list): input signals and outputs of seven segment displays
    Returns:
        the count of output digits that are 1, 4, 7, or 8
    """
    count = 0
    for pattern in signals_and_outputs:
        output = pattern[1].split(" ")
        for segments in output:
            if len(segments) in [2, 3, 4, 7]:
                count += 1
    return count