




'''simple docstring'''





def UpperCAmelCase    (       UpperCAmelCase_						):
    _a				:							Any							       =      5_381
    for x in s:
        _a				:							List[str]							       =      ((hash_value << 5) + hash_value) + ord(UpperCAmelCase_						)
    return hash_value & 0xF_F_F_F_F_F_F_F








def    UpperCAmelCase__	(  lowerCamelCase ):
  lowercase     :Optional[int]   						=    len(lowerCamelCase )
  if n in (0, 1):
    return 0
  return sum(query * (n - i - 1) for i, query in enumerate(sorted(lowerCamelCase ) ) )


if __name__ == "__main__":
     import doctest

     doctest.testmod()



