input: Write a python function to count the number of common characters between two strings.
  assert compare_str("My cat", "Tasty snacks") == 3
  assert compare_str("hello", "world") == 2
  assert compare_str("abc", "def") == 0
output: def compare_str(str1, str2):
      return len(set(str1) & set(str2))