


'''simple docstring'''

def __snake_case      (   UpperCAmelCase_		:		int = 1000	):
 lowerCamelCase_  				=						2**power
 lowerCamelCase_  				=						0
 while n:
  lowerCamelCase_				,lowerCamelCase_  				=						r + n % 10, n // 10
 return r


if __name__ == "__main__":
     print(solution(int(str(input()).strip())))







'''simple docstring'''

def __snake_case      (   UpperCAmelCase_		:		int = 100	):
 lowerCamelCase_  				=						n * (n + 1) * (2 * n + 1) / 6
 lowerCamelCase_  				=						(n * (n + 1) / 2) ** 2
 return int(square_of_sum - sum_of_squares	)


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



