input: 
  def num_common_substrings(s1: str, s2: str) -> int:
      """ Given two strings, return the number of common substrings between them.
      A substring is defined as any consecutive sequence of characters within a string.
      >>> num_common_substrings("abcd", "bae")
      2
      """
  
output:     
      count = 0
      for i in range(len(s1)):
          for j in range(len(s2)):
              k = 0
              while i + k < len(s1) and j + k < len(s2) and s1[i + k] == s2[j + k]:
                  k += 1
              count += k
      return count
  