#include<stdio.h>

long long f(long long x){
  long long i,r=1,c;
  for(i=2;i*i<=x;i++){
    c=1;
    while(x%i==0){x/=i;c++;}
    r*=c;
  }
  if(x!=1){r*=2;}
  return r;
}

long long mem[1024]={0,493188984,2111351377,4932719787,9000217396,14341975240,20979949232,28934911754,38219137945,48848842736,60834590672,74188187476,88913406577,105029584674,122534960219,141439665788,161754866784,183478793576,206627911130,231199170456,257204070774,284640691691,313525342845,343850958416,375620565395,408866702660,443544368601,479696200366,517313462431,556405007715,596959615450,638991877350,682513770555,727505683373,773989011906,821969325762,871438477626,922405992974,974857228674,1028817951678,1084277409104,1141246183482,1199719531446,1259695667514,1321207032726,1384221175499,1448749178605,1514793415551,1582358543782,1651483119360,1722104036282,1794210310039,1867901745253,1943135763556,2019854716903,2098152047461,2177945952180,2259299996967,2342211960421,2426653806008,2512610922551,2600171880059,2689216435198,2779817182839,2872041740842,2965753104633,3061009397282,3157890365183,3256249870052,3356214349093,3457720222390,3560797991555,3665419298976,3771628500331,3879407180190,3988747740289,4099636715648,4212079072325,4326133768544,4441748952022,4558944334475,4677738907734,4798050797041,4919959163900,5043434408724,5168508295617,5295162400044,5423400803310,5553231201415,5684634842328,5817632517828,5952157621195,6088364061000,6226056254802,6365431371753,6506361585007,6648892032736,6792994052516,6938755302589,7085987799955,7235013807366,7385447422168,7537472629369,7691221042181,7846511085002,8003384992854,8161939609593,8322012166301,8483703662004,8647105790700,8811960422862,8978438345553,9146605696165,9316362543328,9487645173018,9660650955296,9835188587927,10011378256671,10189182611315,10368548669769,10549544020862,10732311096534,10916506531860,11102330274617,11289817737263,11478961688245,11669603374971,11861966269733,12055986549904,12251488620346,12448751577256,12647615129690,12847986570860,13050121462297,13253879758691,13459161658561,13666117310773,13874765696455,14084928921507,14296744968805,14510214407222,14725288439492,14942046034656,15160378193552,15380394554554,15602049739002,15825316057376,16050231160910,16276743420856,16505041162434,16734798755096,16966189126222,17199326014438,17433940556672,17670329659840,17908388787130,18148023097132,18389392743932,18632238527852,18876847937424,19123042141378,19370888907390,19620499818748,19871604489154,20124362069606,20378859733244,20634881280846,20892702909876,21151942187700,21413131904304,21675710825770,21940050012852,22206021881006,22473769135042,22742971471196,23013841872551,23286540174789,23560711221575,23836662764907,24114288906399,24393407493809,24674326429987,24956728915787,25241010314980,25526851556870,25814298354826,26103393746734,26394363063000,26686761499848,26980777333407,27276684556759,27574291155175,27873324207821,28174062848173,28476477764494,28780554606772,29086427671688,29393867555558,29702792603024,30013692637851,30326301365285,30640194292273,30955948454443,31273320102626,31592378849728,31913253078550,32235719332848,32559719490049,32885597839643,33213011430143,33542055868005,33872925665364,34205433185566,34539391444304,34875296863721,35212683420453,35551808566961,35892669791151,36235386612420,36579338281204,36925274266686,37272656068179,37621901032867,37972872125527,38325445456310,38679708676812,39035552083706,39393116006853,39752308429789,40113223434391,40476083299052,40840063066648,41206225798402,41574024383741,41943255482207,42314226955206,42686971085026,43061248153064,43437402186881,43815183169763,44194574398353,44575811986140,44958857632376,45343208245399,45729350371181,46117291059977,46506744689452,46897942118372,47290924561301,47685479865579,48081874935671,48479956800526,48879441471808,49280857607237,49683934592257,50088637167842,50495313517520,50903338100692,51313037925789,51724716620189,52137905087538,52552716827972,52969424301827,53387636111137,53807540920230,54229383299288,54652879494933,55077941662363,55504772790211,55933081247316,56363227130452,56795077276465,57228665158313,57663669816822,58101075318024,58539515099783,58979865841083,59421753848898,59865539529526,60310840725171,60758115385743,61207029966520,61657415340090,62109864057983,62563676383571,63019225631040,63476552929040,63935671271999,64396397979171,64859053535018,65322973991149,65788798604569,66256425018190,66725685008196,67196625566221,67669601128369,68143609334308,68619558785028,69097857848615,69577395425039,70058491460280,70541286609951,71025757305929,71512149345322,72000337836936,72490043710653,72981161691617,73474585978198,73969371369251,74466015672669,74964331909988,75464587816958,75965956320027,76469765685833,76974729904364,77481219106093,77989895776087,78500330797008,79012175424984,79525848516159,80041316590312,80558324237098,81077208580197,81597732713779,82120146079294,82644125895127,83169746389863,83697177542732,84226132194512,84756902028297,85289686553688,85823790698104,86359762565751,86897381037014,87437106993462,87978117105507,88520797824739,89065664937896,89611844445041,90159838388367,90709495243282,91261121998831,91814054546287,92369394296000,92925520739321,93484013284737,94044251897514,94605519093587,95169131829369,95734562126700,96301226878991,96870301843775,97440438250114,98012361759925,98586179692967,99161819503100,99739214976165,100318081327755,100899043477840,101481412256225,102065336749715,102651798028038,103239058546737,103828603117875,104419195655676,105012451748303,105606648455847,106203075404286,106800920305039,107400594443134,108002002998516,108605298699699,109209891871028,109816712093848,110425173005189,111035049416856,111646959753880,112260601633767,112875506874318,113492892665965,114111488721375,114731748627940,115354352355727,115978183051469,116603740340710,117230986199853,117860113820030,118490877197962,119123625322237,119758033896194,120393767484663,121031816586387,121671292436798,122312381834877,122955375935878,123600102753238,124246396470109,124894827988944,125544740206721,126196195528335,126850297017804,127504998891685,128161756412474,128820250080288,129480569276751,130142707066922,130806331628029,131472084663433,132139210685890,132808476412837,133479171889246,134151599492156,134826006851391,135501694129054,136179320855547,136858789394801,137540059359704,138222973236401,138907656208408,139593903655195,140281912187827,140971724553758,141663797436387,142356967538586,143052350102720,143748894948739,144447386555264,145148070213081,145849982304976,146553222642842,147259181982477,147966824634080,148675407576293,149386462822656,150098932629042,150813015261139,151529521244886,152246698978549,152966411795338,153687950019778,154410813069265,155135329267588,155861688488277,156590237411006,157319958312726,158052253943755,158785395403084,159520633147969,160257790768446,160996344567233,161736900121483,162478783078350,163222940296949,163968397251200,164715982197751,165464965572167,166215993034706,166968861292981,167723200431634,168479018246421,169237716381982,169997260457786,170757986884543,171521887925146,172286695034491,173053249479870,173822022314317,174592442586419,175363873574134,176138022780787,176912904075822,177690221049615,178469176128962,179249934544097,180031961444167,180816641174988,181602394770895,182390215296476,183179617604611,183970979422672,184763726482181,185558871780607,186355195516640,187153201627305,187953954912172,188754876873661,189558912974578,190364021783477,191170868042543,191979706355334,192790396474795,193602310910512,194416327505967,195232152987818,196049595414189,196869020666370,197690058488822,198512927115241,199337383367136,200164115228679,200992161246692,201821869836189,202653567117500,203487043624995,204321372538612,205158977851458,205997237855705,206837925919778,207679867859897,208524135046180,209369303256611,210217202280204,211066425106201,211917195290312,212769743252978,213624471221079,214480169417874,215338653446071,216198344617860,217060137926613,217923390958764,218788920315693,219654839682864,220523474157387,221393723949349,222265746117362,223139746233265,224016031533452,224892725739605,225772350113650,226652934765413,227535378232100,228420569866947,229306415564404,230194426028025,231084298915589,231975724279776,232868985913489,233764073846712,234660288050023,235559115783960,236459490943283,237361613211048,238265243958041,239171170912618,240079103075503,240987087432690,241898539160791,242811802047676,243725454770952,244642086171917,245559703111198,246479703761269,247400764616792,248324245080015,249249161129502,250176256359885,251105204718834,252034924516781,252967305735060,253901502351677,254836976382990,255774647245791,256713639305122,257654627328771,258597703267722,259542433330910,260487932767409,261436462920998,262386118983379,263337513503632,264291149134157,265246056318052,266203436065415,267162018132416,268122041379733,269084575798458,270048800460461,271014854038472,271981943915917,272950867022680,273921926156707,274894914021442,275869796762381,276846131540350,277824619031685,278804218450134,279786077249447,280769504435134,281754876246921,282742347306696,283730968078148,284721150129865,285713954195616,286707317787977,287703531795420,288702303995441,289701417807874,290702851709949,291705901953858,292710652081941,293717065974056,294725179525083,295735149476404,296747169838013,297761629514958,298776180822377,299794166387084,300812956019813,301832983727288,302856260162737,303880177840754,304906004454363,305934513362268,306964333946215,307995980856936,309028838658801,310063842723148,311100896305109,312139642024896,313179732581239,314221563621412,315266180257537,316311419620248,317359011162523,318409157982054,319460123826217,320512130122962,321567183251745,322623301942812,323681125695499,324741537891528,325803190187761,326866586740652,327932070055477,328999184677832,330067853916709,331138344528798,332210657030039,333284715240620,334361300092115,335439505191086,336518315709011,337599848346864,338682794063679,339767422320246,340854185183245,341942735196612,343033176400869,344125639365936,345219358513529,346314279629252,347411978157053,348511466468136,349612247806555,350715289647270,351819321816247,352925563027444,354033554901769,355143719364876,356255372073339,357368783008715,358484044995342,359600528797041,360719878876300,361840783744271,362962523350674,364087441554029,365213246991214,366340899308709,367470265030202,368601424664463,369734445749694,370869732707777,372006748776608,373144710996233,374285366747576,375427623591615,376570728444574,377716320592043,378863886658650,380013114473175,381164399340896,382316991422921,383471244567630,384627775031971,385786681267500,386945424242933,388107470127077,389270993033460,390436895829971,391603937566184,392772932237483,393942356287130,395115188241767,396289878634134,397465481494813,398643359408120,399823465930061,401004894478536,402188140344049,403373344133520,404560296247791,405748476528776,406938657285005,408130684592604,409324530708067,410520641475975,411717617308472,412917475216085,414118445106590,415321121637827,416526515700694,417732720700427,418940618116724,420151516263135,421363501583104,422576678980403,423792467823764,425009764561273,426228208269116,427449426002323,428672974489944,429896651046936,431123026488353,432350865093538,433581516147449,434812643123636,436045318357627,437281618750928,438518515275971,439756288372828,440996940238867,442239713285140,443484021891313,444730232754762,445977603255250,447227118605997,448478758397544,449732878946751,450986700850746,452243283673393,453502490619818,454763151311227,456024394192066,457289611813673,458554799724046,459821743661615,461091902314555,462362959727082,463635175079489,464911444922952,466187010863221,467465613121452,468745711202817,470027757141922,471310640514047,472597824788748,473884817632371,475173076334501,476464286195706,477757363830055,479051502066724,480348056350435,481646647402860,482945876439277,484248052483034,485551546622173,486856971564978,488164189698429,489472592962655,490783520733168,492096103748075,493410913679502,494726296117357,496044765301936,497364634768609,498685895477284,500010102062547,501334968966526,502661123841804,503990923580965,505321114581958,506652866172067,507987941709970,509323741044955,510660896977448,512001139456817,513341952035826,514685247546604,516030507404871,517376933607508,518725442674553,520077352300410,521428579674467,522782486474442,524138574759187,525496144837174,526855506990838,528216645408577,529581072274134,530945461193627,532311353414760,533679743735483,535050578771342,536422347695403,537795724603370,539171394925316,540549231457205,541928418707352,543309765215741,544693069779016,546076822908393,547463223046802,548852371240761,550241540951411,551634055126500,553027803646503,554423897113560,555819807061929,557220200409512,558621286005469,560024243661866,561428390776184,562835406308759,564242844095306,565653094768561,567064714922242,568478299430125,569893542299790,571311016010574,572729409277725,574151090390562,575573999034959,576998225149768,578425253453253,579852705198684,581282048724127,582714047178061,584148066172108,585582451918129,587021497000674,588458560012505,589900093512440,591342984367211,592786698917657,594233027340282,595680880150359,597131443746714,598582896209687,600035931526326,601491391580143,602948128621683,604407420445578,605868082889303,607330080426194,608795183534189,610261357348438,611727715717537,613198384993223,614669830958276,616142954283965,617619108065780,619095673238785,620574018952334,622055338989353,623537515945969,625021812570734,626508308216503,627995970401640,629484779679553,630976641484618,632470505233598,633965079721247,635462065701108,636960555455435,638461205147104,639963963587269,641468840758646,642973754730974,644481955653419,645992682294254,647502823872109,649016858037750,650531123517315,652048473718977,653567158869176,655087771885491,656609132320008,658133885989261,659660641199214,661186930690086,662717724356195,664249075506936,665782312206535,667317882340188,668854434973177,670393573176565,671933377959436,673475383039307,675020192919670,676566243364893,678112747944156,679662727401168,681214270969811,682767495722362,684321993711191,685880321047598,687438080891527,688998437928499,690560084562114,692125287696273,693690724454624,695259420986021,696828740832270,698399878891086,699973183471271,701548756831838,703123984335455,704704740732828,706284736357381,707866274732873,709450885672926,711037069008427,712623207149158,714213401234419,715805445644514,717398534158778,718993388345727,720590212650446,722189063501363,723789224980140,725392270721004,726997122073987,728602667742062,730210559284985,731819076359290,733431541695075,735044726205207,736660504613214,738275702389247,739895412258532,741515451192161,743137502553167,744761472806730,746386729301993,748015417970068,749645839571567,751275946317719,752910210922144,754545306527913,756182285791540,757820520825127,759460953475294,761103480242634,762747681977255,764394036433220,766041511272075,767691761856182,769343957049218,770996177437057,772652646011276,774308560524197,775966889481206,777627740954614,779290383936659,780954364498140,782620754701333,784289730863104,785957690811126,787629514795247,789303276999222,790979123833981,792655382727226,794335127356712,796015048077051,797697277405268,799381787787517,801067876623796,802755465093190,804446355547769,806137933470524,807831069546729,809525743546184,811223056823428,812922913620281,814623235791302,816325569076999,818029933916686,819736568578338,821444405339323,823155711963724,824865920441477,826580344675850,828294956393646,830012596599069,831730958364316,833453268840721,835175113459152,836898953119010,838626648460105};

int main(){
  long long i,r=0;
  //for(i=1;i<=10000000;i++){
  //  if(i%10000==0){printf("%lld,",r);}
  //  r+=i*f(i);
  //}
  long long n,st;
  scanf("%lld",&n);
  r=mem[n/10000];
  st=(n/10000)*10000;
  for(i=st;i<=n;i++){r+=i*f(i);}
  printf("%lld\n",r);
  return 0;
}


Measured memory_bytes: 1708