def number_of_common_3grams(string1, string2):
    """ Return the number of common tri-grams in two strings
    """
    # Pure Python implementation: no numpy
    tri_grams = set(zip(string1, string1[1:], string1[2:]))
    tri_grams = tri_grams.intersection(zip(string2, string2[1:],
                                           string2[2:]))
    return len(tri_grams)