Given the number *n*, find the smallest positive integer which has exactly *n* divisors. It is guaranteed that for the given *n* the answer will not exceed 10<sup class="upper-index">18</sup>.
The first line of the input contains integer *n* (1 ≤ *n* ≤ 1000).
p=["1","2","4","6","16","12","64","30","36","48","1024","60","4096","192","144","210","65536","180","262144","240","576","3072","4194304","420","1296","12288","900","960","268435456","720","1073741824","2310","9216","196608","5184","1260","68719476736","786432","36864","1680","1099511627776","2880","4398046511104","15360","3600","12582912","70368744177664","4620","46656","6480","589824","61440","4503599627370496","6300","82944","6720","2359296","805306368","288230376151711744","5040","1152921504606846976","3221225472","14400","30030","331776","46080","73786976294838206464","983040","37748736","25920","1180591620717411303424","13860","4722366482869645213696","206158430208","32400","3932160","746496","184320","302231454903657293676544","18480","44100","3298534883328","1","20160","5308416","13194139533312","2415919104","107520","1","25200","2985984","62914560","9663676416","211106232532992","21233664","60060","1","233280","230400","45360",
"1","2949120","1","430080","129600","13510798882111488","1","69300","1","414720","618475290624","73920","1","11796480","339738624","4026531840","921600","864691128455135232","47775744","55440","60466176","3458764513820540928","9895604649984","16106127360","810000","100800","1","510510","39582418599936","1658880","1","322560","191102976","221360928884514619392","176400","6881280","1","188743680","1","181440","633318697598976","3541774862152233910272","241864704","180180","21743271936","14167099448608935641088","1166400","1030792151040","1","226800","1","27525120","14745600","3732480","86973087744","1290240","1","906694364710971881029632","40532396646334464","240240","3057647616","485100","1","16492674416640","2073600","1","1","221760","2176782336","26542080","58982400","65970697666560","1","12079595520","3240000","1182720","2594073385365405696","1","1","277200","1","14929920","10376293541461622784","440401920","5566277615616","48318382080","3869835264","1055531162664960","705600","106168320","1","1021020","1","1","8294400","1632960","1","1612800","1","498960",
"664082786653543858176","1","195689447424","20643840","89060441849856","1","943718400","4730880","15479341056","907200","1","67553994410557440","10625324586456701730816","1","356241767399424","900900","782757789696","1","42501298345826806923264","2903040","34828517376","3092376453120","1","960960","1587600","1","1","82575360","1","1698693120","18662400","28185722880","1","6451200","5699868278390784","4323455642275676160","1","238878720","1","720720","1","302330880","5336100","17293822569102704640","29160000","49478023249920","139314069504","112742891520","1","5670000","1","1108800","247669456896","1","132710400","9699690","1","197912092999680","50096498540544","11612160","60397977600","1","1","3548160","364791569817010176","955514880","1","1106804644422573096960","1","1940400","1","75694080","74649600","1","51840000","1321205760","1","1","241591910400","1995840","1","3166593487994880","1","17708874310761169551360","530841600","1209323520","801543976648704","3063060","2821109907456","108716359680","1","70835497243044678205440","1","8164800","23346660468288651264","7215545057280","11289600","1","2229025112064","2494800",
"3206175906594816","1","1","302776320","93386641873154605056","103219200","1","26127360","1","434865438720","1","14192640","1","1","6350400","1","1","202661983231672320","15850845241344","4084080","1","15288238080","11284439629824","6306300","207360000","1","1","115448720916480","51298814505517056","14515200","1","1","15461882265600","1","5976745079881894723584","2882880","1","10883911680","1","185794560","63403380965376","412876800","729000000","461794883665920","8493465600","1","1","84557168640","1","22680000","45158400","15375360","1","12970366926827028480","95627921278110315577344","1","1194393600","1","1","3603600","101559956668416","1","1511654400","104509440","382511685112441262309376","51881467707308113920","1","4844421120","247390116249600","27831388078080","3283124128353091584","338228674560","1","19349176320","39690000","7388718138654720","142657607172096","7761600","1","743178240","1","1","1","19399380","466560000","1","989560464998400","1","1","58060800","180551034077184","17962560","1","1","1","17740800","1","1","4777574400","6486480",
"1","3320413933267719290880","570630428688384","1","21344400","978447237120","4057816381784064","227082240","1","445302209249280","1","1","210119944214597861376","6606028800","1","61501440","1","77396705280","1","9979200","1","1","15832967439974400","472877960873902080","3317760000","53126622932283508654080","840479776858391445504","1","6046617600","1781208836997120","1","15315300","1","3913788948480","543581798400","1","1624959306694656","212506491729134034616320","1","31933440","57153600","174142586880","1","21646635171840","1","1","1","16336320","1","17463600","64925062108545024","1","1","1","1866240000","908328960","1","1","722534400","11890851840","1","130636800","1","310042951680","2174327193600","1","1","70963200","53790705718937052512256","28499341391953920","1","30264189495929733120","259700248434180096","1","13271040000","1672151040","1013309916158361600","1","1","12252240","36520347436056576","1","76441190400","2116316160","1","69369300","1","121056757983718932480","1","204120000","1","346346162749440","11555266180939776","696570347520","101606400","1240171806720","860651291502992840196096","1","1","62370000",
"1","1","1","14414400","1","1238347284480","54419558400","1","1","928972800","1","223092870","2890137600","1","1","1385384650997760","4155203974946881536","250482492702720","1","127733760","1","422785843200","1","1","158760000","1","46221064723759104","46126080","131621703842267136","1823957849085050880","64851834634135142400","6688604160","584325558976905216","1","1","7747632510958011678720","1","1","11664000000","25225200","1","1","1","984023040","1","522547200","1","1","259407338536540569600","362880000","103997395628457984","14533263360","1","1","139156940390400","1","1","1691143372800","2337302235907620864","25945920","96745881600","1","1","22166154415964160","1","1","85377600","123962120175328186859520","1","3715891200","1","8465264640","1","4007719883243520","212336640000","58198140","1","14105549537280","1","761014517760","1","1","265933054396600418304","495848480701312747438080","406425600","1","1","89812800","415989582513831936","116733302341443256320","1","79370995630080","1","124185600","29859840000","1","1","11145125560320","1","32432400",
"1","16030879532974080","16602069666338596454400","1","37791360000","1","1","3936092160","4892236185600","466933209365773025280","37396835774521933824","1135411200","1","1","2226511046246400","287400960","1","1","1","3044058071040","46242201600","1","1","184504320","1944810000","1","386983526400","1","2958148142320582656","69854400","1","1","1","1","1","1418633882621706240","46656000000","79254226206720","265633114661417543270400","77597520","1","1","1","107017666560","8906044184985600","56422198149120","1","107207100","17019715481382426771456","1451520000","19568944742400","1","1","1","1","1269935930081280","1","256494072527585280","1","159667200","1","1","870712934400","1","119439360000","108233175859200","8423789045905096704","1","1","29883725399409473617920","68078861925529707085824","49008960","1","1","192099600","76187381760","1","1","1","2043740160","1","317016904826880","1","4541644800","1","5103000000","1","5079743720325120","2393397489569403764736","59454259200","1","1","914457600","1","1","930128855040","47330370277129322496","1","1","249480000",
"1","496742400","26623333280885243904","261381120","142496706959769600","1","1","90792568487789199360","1","478139606390551577886720","1","1","33695156183620386816","8360755200","151165440000","1","1","1","1","61261200","1","507799783342080","1","1","13589544960000","10581580800","1","1149603840","901800900","1","189321481108517289984","363170273951156797440","1","1","1428840000","62977474560","1","1731730813747200","1","194819716546560","3482851737600","16415620641765457920","1","3720515420160","1","1","1","135444234240","1","436590000","1","81275899525201920","1","713288035860480","1","100900800","1","1","6191736422400","8174960640","1","1","1","1","6502809600","1","153177439332441840943104","446185740","1","3265920000","1","1","1","6926923254988800","54358179840000","1","1252412463513600","1","425973332494163902464","638668800","1","902755170385920","2959500902400","233513280","1","1","1","1","1","1","1","230630400","612709757329767363772416","1","9119789245425254400","1","1","33443020800","3029143697736276639744","110270160",
"1","1","1","23242897532874035036160","1911029760000","2853152143441920","1","1","1","277477200","1","6849130659840","1","20289081908920320","1","2952069120","1703893329976655609856","1","3657830400","3117115464744960","1","1","1","1","2540160000","1050599721072989306880","1","72666316800","1","1","1","1045524480","746496000000","1","1","541776936960","11838003609600","1","1","129729600","6140942214464815497216","1","1","1","1360488960000","110830772079820800","944784000000","5201657569612922880","1","23224320000","2156489995751704756224","371886360525984560578560","1","4202398884291957227520","26011238400","1","1","42326323200","1","12468461858979840","20038599416217600","1","1","290990700","1","1","70527747686400","27396522639360","1","3805072588800","1","1","1","8124796533473280","7779240000","1","1","1","1","415134720","1","628689600","1","1218998108160","583666511707216281600","1","1","238112986890240","1","1","1366041600","1","27262293279626489757696","1","1","310390080","55725627801600","1","24563768857859261988864","227026800",
"193865196655121704943616","324625310542725120","80154397664870400","1","1","1","1","1","1","13063680000","1","11808276480","1","1","2334666046828865126400","1","1","7947878400","1","130799370240","1","1","1","1437004800","3478923509760000","1","1","4030558371840","1","15220290355200","2985984000000","1","1","1","2418647040000","922521600","1","268953528594685262561280","1","199495389743677440","1","1","34503839932027276099584","332906084455227064320","768398400","1298501242170900480","1","1","1","92897280000","1","18393661440","1","7093169413108531200","1","1","396271131033600","1","1","232792560","221073919720733357899776","182601737180282880","1","1","1","535088332800","1","23279477760","282110990745600","1","1","1179278100","1","1","10160640000","1331624337820908257280","1","1","1","2245320000","1","1","1","3809807790243840","1","57776330904698880","1282470362637926400","4875992432640","138015359728109104398336","1117670400","1","16122233487360","1","1","1","1","1","1","757632231014400","810810000"]
n=int(input())
print(p[n-1])
 		  			  	 						 	 				 		  	