






from typing import Dict, Optional, Tuple

import torch


def     _a					(       UpperCamelCase_   :			torch.Tensor				)	->				torch.Tensor:
						"""simple docstring"""







						lowerCAmelCase__	 =  boundaries[1] - boundaries[0]
						lowerCAmelCase__	 =  boundaries + step / 2
						lowerCAmelCase__	 =  torch.cat([bin_centers, (bin_centers[-1] + step).unsqueeze(-1				)]      ,				dim=0				)
						return bin_centers


def     _a					(       UpperCamelCase_   :			torch.Tensor      ,				UpperCamelCase_   :			torch.Tensor      ,				)	->				Tuple[torch.Tensor, torch.Tensor]:
						"""simple docstring"""







						lowerCAmelCase__	 =  _calculate_bin_centers(__lowercase				)
						return (
						    torch.sum(aligned_distance_error_probs * bin_centers      ,				dim=-1				),
						    bin_centers[-1],
						)


def     _a					(       UpperCamelCase_   :			torch.Tensor      ,				UpperCamelCase_   :			int = 31      ,				UpperCamelCase_   :			int = 64      ,				**UpperCamelCase_   :			Tuple      ,				)	->				Dict[str, torch.Tensor]:
						"""simple docstring"""







						lowerCAmelCase__	 =  torch.linspace(0      ,				__lowercase      ,				steps=(no_bins - 1)      ,				device=logits.device				)

						lowerCAmelCase__	 =  torch.nn.functional.softmax(__lowercase      ,				dim=-1				)
						lowerCAmelCase__ ,							lowerCAmelCase__	 =  _calculate_expected_aligned_error(
						    alignment_confidence_breaks=__lowercase      ,				aligned_distance_error_probs=__lowercase      ,				)

						return {
						    "aligned_confidence_probs": aligned_confidence_probs,
						    "predicted_aligned_error": predicted_aligned_error,
						    "max_predicted_aligned_error": max_predicted_aligned_error,
						}





def     _a					(       UpperCamelCase_   :			torch.Tensor      ,				UpperCamelCase_   :			Optional[torch.Tensor] = None      ,				UpperCamelCase_   :			int = 31      ,				UpperCamelCase_   :			int = 64      ,				UpperCamelCase_   :			float = 1e-8      ,				**UpperCamelCase_   :			List[Any]      ,				)	->				torch.Tensor:
						"""simple docstring"""







						if residue_weights is None:
												lowerCAmelCase__	 =  logits.new_ones(logits.shape[-2]				)

						lowerCAmelCase__	 =  torch.linspace(0      ,				__lowercase      ,				steps=(no_bins - 1)      ,				device=logits.device				)

						lowerCAmelCase__	 =  _calculate_bin_centers(__lowercase				)
						torch.sum(__lowercase				)
						lowerCAmelCase__	 =  logits.shape[-2]
						lowerCAmelCase__	 =  max(__lowercase      ,				19				)

						lowerCAmelCase__	 =  1.24 * (clipped_n - 15) ** (1.0 / 3) - 1.8

						lowerCAmelCase__	 =  torch.nn.functional.softmax(__lowercase      ,				dim=-1				)

						lowerCAmelCase__	 =  1.0 / (1 + (bin_centers**2) / (da**2))
						lowerCAmelCase__	 =  torch.sum(probs * tm_per_bin      ,				dim=-1				)

						lowerCAmelCase__	 =  residue_weights / (eps + residue_weights.sum())
						lowerCAmelCase__	 =  torch.sum(predicted_tm_term * normed_residue_mask      ,				dim=-1				)

						lowerCAmelCase__	 =  per_alignment * residue_weights

						lowerCAmelCase__	 =  (weighted == torch.max(__lowercase				)).nonzero()[0]
						return per_alignment[tuple(__lowercase				)]














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())))






