#!/usr/bin/python

import sys

def getFactors(n):    
    return set(reduce(list.__add__, 
            ([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0)))

def getHousePresents(house):
	total_presents = 0
	factors = getFactors(house)
	for factor in factors:
		total_presents += factor * 11

	return total_presents


TARGET = 36000000
presents = 0
house = 0
while presents < TARGET:
	presents = 0
	house += 1
	presents = getHousePresents(house)

print(house)