"""simple docstring"""






def      UpperCAmelCase__			(							lowerCAmelCase__	:int = 1_0_0_0						)					->       int:
      '''simple docstring'''


      lowercase								=      2**power
      lowercase								=      0
      while n:
            lowercase				,				lowercase								=      r + n % 1_0, n // 1_0
      return r


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




"""simple docstring"""






def      UpperCAmelCase__			(							lowerCAmelCase__	:int = 1_0**9						)					->       int:
      '''simple docstring'''


      lowercase								=      1
      lowercase								=      2

      lowercase								=      0
      lowercase								=      0
      lowercase								=      0
      while perimeter <= max_perimeter:
            perimeters_sum += perimeter

            prev_value += 2 * value
            value += prev_value

            lowercase								=      2 * value + 2 if i % 2 == 0 else 2 * value - 2
            i += 1

      return perimeters_sum


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



