input: def digit_sum_of_harshad(x: int) -> int:
      """
      A number is called a Harshad number if it is divisible by the sum of its digits. Given an integer x, return the sum of the digits of x if it is a Harshad number; otherwise, return -1.
  
      Examples:
      >>> x = 18
      9
      >>> x = 23
      -1
  
      Constraints:
      1 <= x <= 100
      """
output:     def digit_sum_of_harshad(x: int) -> int:
      digits_sum = sum(int(digit) for digit in str(x))
      if x % digits_sum == 0:
          return digits_sum
      return -1