import math N = int(input()) base = 1000000 N //= 3 N = int(math.sqrt(N)) N //= base print((N+1)*base)