
from math import factorial

__lowerCAmelCase					:			Dict			      =		{str(d): factorial(d) for d in range(10)}


def     UpperCAmelCase_  (						__lowerCAmelCase	) ->						int:
    return sum(DIGIT_FACTORIAL[d] for d in str(__lowerCAmelCase	)	)


def     UpperCAmelCase_  (						) ->						int:
    __lowercase		:			int	    =       7 * factorial(9	) + 1
    return sum(i for i in range(3	,					__lowerCAmelCase	) if sum_of_digit_factorial(__lowerCAmelCase	) == i	)


if __name__ == "__main__":
 print(F'{solution() = }')




import logging
import os
from logging import (
    CRITICAL,  # NOQA
    DEBUG,  # NOQA
    ERROR,  # NOQA
    FATAL,  # NOQA
    INFO,  # NOQA
    NOTSET,  # NOQA
    WARN,  # NOQA
    WARNING,  # NOQA
)
from typing import Optional

from tqdm import auto as tqdm_lib


__lowerCAmelCase					:			int			      =		{
    "debug": logging.DEBUG,
    "info": logging.INFO,
    "warning": logging.WARNING,
    "error": logging.ERROR,
    "critical": logging.CRITICAL,
}

__lowerCAmelCase					:			Optional[int]			      =		logging.WARNING


def     UpperCAmelCase_  (						) ->						Optional[Any]:
    __lowercase		:			Any	    =       os.getenv('''DATASETS_VERBOSITY'''	,					__lowerCAmelCase	)
    if env_level_str:
        if env_level_str in log_levels:
            return log_levels[env_level_str]
        else:
            logging.getLogger().warning(
                F'Unknown option DATASETS_VERBOSITY={env_level_str}, '
                F'has to be one of: { ", ".join(log_levels.keys()	) }'	)
    return _default_log_level


def     UpperCAmelCase_  (						) ->						str:
    return __name__.split('''.'''	)[0]


def     UpperCAmelCase_  (						) ->						logging.Logger:
    return logging.getLogger(_get_library_name()	)


def     UpperCAmelCase_  (						) ->						None:
    # Apply our default configuration to the library root logger.
    __lowercase		:			Union[str, Any]	    =       _get_library_root_logger()
    library_root_logger.setLevel(_get_default_logging_level()	)


def     UpperCAmelCase_  (						) ->						None:
    __lowercase		:			List[Any]	    =       _get_library_root_logger()
    library_root_logger.setLevel(logging.NOTSET	)


def     UpperCAmelCase_  (						__lowerCAmelCase = None	) ->						logging.Logger:
    if name is None:
        __lowercase		:			Optional[Any]	    =       _get_library_name()
    return logging.getLogger(__lowerCAmelCase	)


def     UpperCAmelCase_  (						) ->						int:
    return _get_library_root_logger().getEffectiveLevel()


def     UpperCAmelCase_  (						__lowerCAmelCase	) ->						None:
    _get_library_root_logger().setLevel(__lowerCAmelCase	)


def     UpperCAmelCase_  (						) ->						int:
    return set_verbosity(__lowerCAmelCase	)


def     UpperCAmelCase_  (						) ->						List[str]:
    return set_verbosity(__lowerCAmelCase	)


def     UpperCAmelCase_  (						) ->						Optional[int]:
    return set_verbosity(__lowerCAmelCase	)


def     UpperCAmelCase_  (						) ->						Any:
    return set_verbosity(__lowerCAmelCase	)


def     UpperCAmelCase_  (						) ->						None:
    __lowercase		:			Tuple	    =       False


def     UpperCAmelCase_  (						) ->						None:
    __lowercase		:			Dict	    =       True


# Configure the library root logger at the module level (singleton-like)
_configure_library_root_logger()


class 						__lowerCAmelCase	:



      """simple docstring"""







      def __init__(      self		:       List[Any]				,       *_snake_case		:       List[Any]				,       **_snake_case		:       Dict				):  # pylint: disable=unused-argument
          __lowercase		:			Tuple	    =       args[0] if args else None




      def __iter__(      self		:       Tuple				):
          return iter(self._iterator				)




      def __getattr__(      self		:       Optional[int]				,       _snake_case		:       Union[str, Any]				):

          def empty_fn(*_snake_case		:       Tuple				,       **_snake_case		:       int				):  # pylint: disable=unused-argument
              return

          return empty_fn




      def __enter__(      self		:       Optional[Any]				):
          return self




      def __exit__(      self		:       Optional[Any]				,       _snake_case		:       Any				,       _snake_case		:       List[Any]				,       _snake_case		:       List[Any]				):
          return






__lowerCAmelCase					:			int			      =		True


class 						__lowerCAmelCase	:



      """simple docstring"""







      def __call__(      self		:       List[str]				,       *_snake_case		:       Dict				,       _snake_case		:       str=False				,       **_snake_case		:       List[str]				):
          if _tqdm_active and not disable:
              return tqdm_lib.tqdm(*_snake_case				,       **_snake_case				)
          else:
              return EmptyTqdm(*_snake_case				,       **_snake_case				)




      def 		snake_case_			(      self		:       Optional[Any]				,       *_snake_case		:       str				,       **_snake_case		:       List[str]				):
          __lowercase		:			Dict	    =       None
          if _tqdm_active:
              return tqdm_lib.tqdm.set_lock(*_snake_case				,       **_snake_case				)




      def 		snake_case_			(      self		:       Tuple				):
          if _tqdm_active:
              return tqdm_lib.tqdm.get_lock()






__lowerCAmelCase					:			Tuple			      =		_tqdm_cls()


def     UpperCAmelCase_  (						) ->						bool:
    global _tqdm_active
    return bool(_tqdm_active	)


def     UpperCAmelCase_  (						) ->						Union[str, Any]:
    global _tqdm_active
    __lowercase		:			Dict	    =       True





def     UpperCAmelCase_  (						) ->						Tuple:
    global _tqdm_active
    __lowercase		:			Optional[int]	    =       False


