






import torch.nn as nn

from .imports import is_fpa_available


if is_fpa_available():
	import transformer_engine.pytorch as te


def     _a					(       UpperCamelCase_   :			int      ,				UpperCamelCase_   :			Any=True      ,				UpperCamelCase_   :			List[Any]=True      ,				UpperCamelCase_   :			Tuple=True				)	->				Any:
						"""simple docstring"""







						if not is_fpa_available():
												raise ImportError("Using `convert_model` requires transformer_engine to be installed."				)
						for name, module in model.named_children():
												if isinstance(UpperCamelCase_      ,				nn.Linear				) and to_transformer_engine and _convert_linear:
																		# Return early if the linear layer weights are not multiples of 16
																		if any(p % 16 != 0 for p in module.weight.shape				):
																								return
																		lowerCAmelCase__	 =  module.bias is not None
																		lowerCAmelCase__	 =  te.Linear(
																		    module.in_features      ,				module.out_features      ,				bias=UpperCamelCase_      ,				params_dtype=module.weight.dtype				)
																		lowerCAmelCase__	 =  module.weight.data.clone()
																		if has_bias:
																								lowerCAmelCase__	 =  module.bias.data.clone()

																		setattr(UpperCamelCase_      ,				UpperCamelCase_      ,				UpperCamelCase_				)
												elif isinstance(UpperCamelCase_      ,				nn.LayerNorm				) and to_transformer_engine and _convert_ln:
																		lowerCAmelCase__	 =  te.LayerNorm(module.normalized_shape[0]      ,				eps=module.eps      ,				params_dtype=module.weight.dtype				)
																		lowerCAmelCase__	 =  module.weight.data.clone()
																		lowerCAmelCase__	 =  module.bias.data.clone()

																		setattr(UpperCamelCase_      ,				UpperCamelCase_      ,				UpperCamelCase_				)
												elif isinstance(UpperCamelCase_      ,				te.Linear				) and not to_transformer_engine and _convert_linear:
																		lowerCAmelCase__	 =  module.bias is not None
																		lowerCAmelCase__	 =  nn.Linear(
																		    module.in_features      ,				module.out_features      ,				bias=UpperCamelCase_      ,				params_dtype=module.weight.dtype				)
																		lowerCAmelCase__	 =  module.weight.data.clone()
																		if has_bias:
																								lowerCAmelCase__	 =  module.bias.data.clone()

																		setattr(UpperCamelCase_      ,				UpperCamelCase_      ,				UpperCamelCase_				)
												elif isinstance(UpperCamelCase_      ,				te.LayerNorm				) and not to_transformer_engine and _convert_ln:
																		lowerCAmelCase__	 =  nn.LayerNorm(module.normalized_shape[0]      ,				eps=module.eps      ,				params_dtype=module.weight.dtype				)
																		lowerCAmelCase__	 =  module.weight.data.clone()
																		lowerCAmelCase__	 =  module.bias.data.clone()

																		setattr(UpperCamelCase_      ,				UpperCamelCase_      ,				UpperCamelCase_				)
												else:
																		convert_model(
																		    UpperCamelCase_      ,				to_transformer_engine=UpperCamelCase_      ,				_convert_linear=_convert_linear      ,				_convert_ln=_convert_ln      ,				)





def     _a					(       UpperCamelCase_   :			Tuple				)	->				Optional[Any]:
						"""simple docstring"""







						if not is_fpa_available():
												raise ImportError("Using `has_transformer_engine_layers` requires transformer_engine to be installed."				)
						for m in model.modules():
												if isinstance(UpperCamelCase_      ,				(te.LayerNorm, te.Linear)				):
																		return True
						return False














def     _a					(       UpperCamelCase_   :			int = 100				)	->				int:
						"""simple docstring"""







						lowerCAmelCase__	 =  1
						lowerCAmelCase__	 =  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())))






