def count_common_subsequences(seq_1, seq_2):
    """Find the number of common subsequences between two collections.

    This function finds the number of common subsequences between two
    collections but does not return an actual listing of those subsequences.
    This is more space efficient O(len(seq_1)) than find_common_subsequences.

    > number_of_subsequences = count_common_subsequences('qwer', 'qewr')
    > print number_of_subsequences
    12

    @param seq_1: The first collection to find subsequences in.
    @type seq_1: Any integer indexable collection (list, tuple, etc.)
    @param seq_2: The second collection to find subsequences in.
    @type seq_2: Any integer indexable collection (list, tuple, etc.)
    @return: The number of common subsequences between seq_1 and seq_2.
    @rtype: int
    """
    if len(seq_1) < len(seq_2):
        new_seq_1 = seq_2
        seq_2 = seq_1
        seq_1 = new_seq_1
    seq_1_len = len(seq_1)
    seq_2_len = len(seq_2)
    seq_1_len_plus_1 = seq_1_len + 1
    seq_2_len_plus_1 = seq_2_len + 1
    subseq_last_row = [1] * seq_2_len_plus_1
    subseq_current_row = [1] + [0] * seq_2_len
    for row in range(1, seq_1_len_plus_1):
        for col in range(1, seq_2_len_plus_1):
            if seq_1[row - 1] == seq_2[col - 1]:
                new_cell_value = 2 * subseq_last_row[col - 1]
            else:
                new_cell_value = subseq_last_row[col]
                new_cell_value += subseq_current_row[col - 1]
                new_cell_value -= subseq_last_row[col - 1]
            subseq_current_row[col] = new_cell_value
        subseq_last_row = subseq_current_row
        subseq_current_row = [1] + [0] * seq_2_len
    return subseq_last_row[seq_2_len]
