



from copy import deepcopy



class 	lowerCamelCase__      :




		'''simple docstring'''



		def __init__(self		,__lowerCamelCase = None		,__lowerCamelCase = None			)					->      None:

						"""simple docstring"""






						if arr is None and size is not None:
										lowerCAmelCase__					:    Optional[int]												=					size
										lowerCAmelCase__					:    Optional[int]												=					[0] * size
						elif arr is not None:
										self.init(__snake_case			)
						else:
										raise ValueError('''Either arr or size must be specified'''			)



		def 		lowerCAmelCase__				(self		,__lowerCamelCase			)					->      None:

						"""simple docstring"""






						lowerCAmelCase__					:    Optional[Any]												=					len(__snake_case			)
						lowerCAmelCase__					:    int												=					deepcopy(__snake_case			)
						for i in range(1		,self.size			):
										lowerCAmelCase__					:    Any												=					self.next_(__snake_case			)
										if j < self.size:
														self.tree[j] += self.tree[i]



		def 		lowerCAmelCase__				(self			)					->      list[int]:

						"""simple docstring"""






						lowerCAmelCase__					:    Dict												=					self.tree[:]
						for i in range(self.size - 1		,0		,-1			):
										lowerCAmelCase__					:    Optional[Any]												=					self.next_(__snake_case			)
										if j < self.size:
														arr[j] -= arr[i]
						return arr



		@staticmethod
		def 		lowerCAmelCase__				(__lowerCamelCase			)					->      int:

						"""simple docstring"""






						return index + (index & (-index))



		@staticmethod
		def 		lowerCAmelCase__				(__lowerCamelCase			)					->      int:

						"""simple docstring"""






						return index - (index & (-index))



		def 		lowerCAmelCase__				(self		,__lowerCamelCase		,__lowerCamelCase			)					->      None:

						"""simple docstring"""






						if index == 0:
										self.tree[0] += value
										return
						while index < self.size:
										self.tree[index] += value
										lowerCAmelCase__					:    Optional[Any]												=					self.next_(__snake_case			)



		def 		lowerCAmelCase__				(self		,__lowerCamelCase		,__lowerCamelCase			)					->      None:

						"""simple docstring"""






						self.add(__snake_case		,value - self.get(__snake_case			)			)



		def 		lowerCAmelCase__				(self		,__lowerCamelCase			)					->      int:

						"""simple docstring"""






						if right == 0:
										return 0
						lowerCAmelCase__					:    Optional[int]												=					self.tree[0]
						right -= 1  # make right inclusive
						while right > 0:
										result += self.tree[right]
										lowerCAmelCase__					:    Optional[int]												=					self.prev(__snake_case			)
						return result



		def 		lowerCAmelCase__				(self		,__lowerCamelCase		,__lowerCamelCase			)					->      int:

						"""simple docstring"""






						return self.prefix(__snake_case			) - self.prefix(__snake_case			)



		def 		lowerCAmelCase__				(self		,__lowerCamelCase			)					->      int:

						"""simple docstring"""






						return self.query(__snake_case		,index + 1			)



		def 		lowerCAmelCase__				(self		,__lowerCamelCase			)					->      int:

						"""simple docstring"""






						value -= self.tree[0]
						if value < 0:
										return -1

						lowerCAmelCase__					:    Optional[Any]												=					1  # Largest power of 2 <= size
						while j * 2 < self.size:
										j *= 2

						lowerCAmelCase__					:    Dict												=					0

						while j > 0:
										if i + j < self.size and self.tree[i + j] <= value:
														value -= self.tree[i + j]
														i += j
										j //= 2
						return i


if __name__ == "__main__":
					import doctest

					doctest.testmod()






from math import factorial






def      lowerCAmelCase__		(   lowerCamelCase_		:		int = 100):





				'''simple docstring'''

				return sum(map(lowerCamelCase_	,str(factorial(lowerCamelCase_))))


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

