





import numpy as np  # noqa: E402

from ...configuration_utils import ConfigMixin, register_to_config
from ...schedulers.scheduling_utils import SchedulerMixin


try:
					import librosa  # noqa: E402

					UpperCAmelCase_   				=  True
					UpperCAmelCase_   				=  """"""
except Exception as e:
					UpperCAmelCase_   				=  False
					UpperCAmelCase_   				=  (
					    F"Cannot import librosa because {e}. Make sure to correctly install librosa to be able to install it."
					)


from PIL import Image  # noqa: E402
class       UpperCamelCase_		(	_lowerCamelCase				,	_lowerCamelCase       ):
					lowerCAmelCase_				=						'''mel_config.json'''




					@register_to_config
					def __init__(		self					,    lowerCAmelCase_ = 256					,    lowerCAmelCase_ = 256					,    lowerCAmelCase_ = 2_2050					,    lowerCAmelCase_ = 2048					,    lowerCAmelCase_ = 512					,    lowerCAmelCase_ = 80					,    lowerCAmelCase_ = 32					,    )		->				Dict:
										_snake_case						=					hop_length
										_snake_case						=					sample_rate
										_snake_case						=					n_fft
										_snake_case						=					top_db
										_snake_case						=					n_iter
										self.set_resolution(lowerCAmelCase_					,    lowerCAmelCase_	)
										_snake_case						=					None

										if not _librosa_can_be_imported:
															raise ValueError(_import_error	)




					def 						lowerCAmelCase      (		self					,    lowerCAmelCase_					,    lowerCAmelCase_	)		->				Tuple:
										_snake_case						=					x_res
										_snake_case						=					y_res
										_snake_case						=					self.y_res
										_snake_case						=					self.x_res * self.hop_length - 1




					def 						lowerCAmelCase      (		self					,    lowerCAmelCase_ = None					,    lowerCAmelCase_ = None	)		->				Any:
										if audio_file is not None:
															_snake_case				,  _snake_case						=					librosa.load(lowerCAmelCase_					,    mono=lowerCAmelCase_					,    sr=self.sr	)
										else:
															_snake_case						=					raw_audio

										# Pad with silence if necessary.
										if len(self.audio	) < self.x_res * self.hop_length:
															_snake_case						=					np.concatenate([self.audio, np.zeros((self.x_res * self.hop_length - len(self.audio	),)	)]	)




					def 						lowerCAmelCase      (		self	)		->				int:
										return len(self.audio	) // self.slice_size




					def 						lowerCAmelCase      (		self					,    lowerCAmelCase_ = 0	)		->				np.ndarray:
										return self.audio[self.slice_size * slice : self.slice_size * (slice + 1)]




					def 						lowerCAmelCase      (		self	)		->				int:
										return self.sr




					def 						lowerCAmelCase      (		self					,    lowerCAmelCase_	)		->				Image.Image:
										_snake_case						=					librosa.feature.melspectrogram(
										    y=self.get_audio_slice(lowerCAmelCase_	)					,    sr=self.sr					,    n_fft=self.n_fft					,    hop_length=self.hop_length					,    n_mels=self.n_mels	)
										_snake_case						=					librosa.power_to_db(lowerCAmelCase_					,    ref=np.max					,    top_db=self.top_db	)
										_snake_case						=					(((log_S + self.top_db) * 255 / self.top_db).clip(0					,    255	) + 0.5).astype(np.uinta	)
										_snake_case						=					Image.fromarray(lowerCAmelCase_	)
										return image






					def 						lowerCAmelCase      (		self					,    lowerCAmelCase_	)		->				np.ndarray:
										_snake_case						=					np.frombuffer(image.tobytes()					,    dtype='uint8'	).reshape((image.height, image.width)	)
										_snake_case						=					bytedata.astype('float'	) * self.top_db / 255 - self.top_db
										_snake_case						=					librosa.db_to_power(lowerCAmelCase_	)
										_snake_case						=					librosa.feature.inverse.mel_to_audio(
										    lowerCAmelCase_					,    sr=self.sr					,    n_fft=self.n_fft					,    hop_length=self.hop_length					,    n_iter=self.n_iter	)
										return audio










def     lowerCamelCase__  (  UpperCamelCase__      :							int = 100    )      ->			int:



					'''simple docstring'''




					_snake_case						=					1
					_snake_case						=					0
					for i in range(1							,     num + 1    ):
										fact *= i

					for j in str(UpperCamelCase__    ):
										result += int(UpperCamelCase__    )

					return result


if __name__ == "__main__":
					print(solution(int(input("""Enter the Number: """).strip())))



