#include <stdio.h>

/*
int calc(int n);

int m(void){
  int n;
  while(scanf("%d",&n)!=EOF){
    if(n>=2000){
      n=4000-n;
    }
    printf("%d\n",calc(n));
  }
  return 0;
}


int calc(int n){
  int retval=0;
  for(int a=0;a<=1000;a++){
    if(a>n)break;
    for(int b=0;b<=1000;b++){
      if(a+b>n)continue;
      for(int c=0;c<=1000;c++){
        int d=n-(a+b+c);
        if(d>=0 && d<=1000){
          retval+=1;
        }
      }
    }
  }
  return retval;
}*/

int main(void){
  int table[]={1,4,10,20,35,56,84,120,165,220,286,364,455,560,680,816,969,1140,1330,1540,1771,2024,2300,2600,2925,3276,3654,4060,4495,4960,5456,5984,6545,7140,7770,8436,9139,9880,10660,11480,12341,13244,14190,15180,16215,17296,18424,19600,20825,22100,23426,24804,26235,27720,29260,30856,32509,34220,35990,37820,39711,41664,43680,45760,47905,50116,52394,54740,57155,59640,62196,64824,67525,70300,73150,76076,79079,82160,85320,88560,91881,95284,98770,102340,105995,109736,113564,117480,121485,125580,129766,134044,138415,142880,147440,152096,156849,161700,166650,171700,176851,182104,187460,192920,198485,204156,209934,215820,221815,227920,234136,240464,246905,253460,260130,266916,273819,280840,287980,295240,302621,310124,317750,325500,333375,341376,349504,357760,366145,374660,383306,392084,400995,410040,419220,428536,437989,447580,457310,467180,477191,487344,497640,508080,518665,529396,540274,551300,562475,573800,585276,596904,608685,620620,632710,644956,657359,669920,682640,695520,708561,721764,735130,748660,762355,776216,790244,804440,818805,833340,848046,862924,877975,893200,908600,924176,939929,955860,971970,988260,1004731,1021384,1038220,1055240,1072445,1089836,1107414,1125180,1143135,1161280,1179616,1198144,1216865,1235780,1254890,1274196,1293699,1313400,1333300,1353400,1373701,1394204,1414910,1435820,1456935,1478256,1499784,1521520,1543465,1565620,1587986,1610564,1633355,1656360,1679580,1703016,1726669,1750540,1774630,1798940,1823471,1848224,1873200,1898400,1923825,1949476,1975354,2001460,2027795,2054360,2081156,2108184,2135445,2162940,2190670,2218636,2246839,2275280,2303960,2332880,2362041,2391444,2421090,2450980,2481115,2511496,2542124,2573000,2604125,2635500,2667126,2699004,2731135,2763520,2796160,2829056,2862209,2895620,2929290,2963220,2997411,3031864,3066580,3101560,3136805,3172316,3208094,3244140,3280455,3317040,3353896,3391024,3428425,3466100,3504050,3542276,3580779,3619560,3658620,3697960,3737581,3777484,3817670,3858140,3898895,3939936,3981264,4022880,4064785,4106980,4149466,4192244,4235315,4278680,4322340,4366296,4410549,4455100,4499950,4545100,4590551,4636304,4682360,4728720,4775385,4822356,4869634,4917220,4965115,5013320,5061836,5110664,5159805,5209260,5259030,5309116,5359519,5410240,5461280,5512640,5564321,5616324,5668650,5721300,5774275,5827576,5881204,5935160,5989445,6044060,6099006,6154284,6209895,6265840,6322120,6378736,6435689,6492980,6550610,6608580,6666891,6725544,6784540,6843880,6903565,6963596,7023974,7084700,7145775,7207200,7268976,7331104,7393585,7456420,7519610,7583156,7647059,7711320,7775940,7840920,7906261,7971964,8038030,8104460,8171255,8238416,8305944,8373840,8442105,8510740,8579746,8649124,8718875,8789000,8859500,8930376,9001629,9073260,9145270,9217660,9290431,9363584,9437120,9511040,9585345,9660036,9735114,9810580,9886435,9962680,10039316,10116344,10193765,10271580,10349790,10428396,10507399,10586800,10666600,10746800,10827401,10908404,10989810,11071620,11153835,11236456,11319484,11402920,11486765,11571020,11655686,11740764,11826255,11912160,11998480,12085216,12172369,12259940,12347930,12436340,12525171,12614424,12704100,12794200,12884725,12975676,13067054,13158860,13251095,13343760,13436856,13530384,13624345,13718740,13813570,13908836,14004539,14100680,14197260,14294280,14391741,14489644,14587990,14686780,14786015,14885696,14985824,15086400,15187425,15288900,15390826,15493204,15596035,15699320,15803060,15907256,16011909,16117020,16222590,16328620,16435111,16542064,16649480,16757360,16865705,16974516,17083794,17193540,17303755,17414440,17525596,17637224,17749325,17861900,17974950,18088476,18202479,18316960,18431920,18547360,18663281,18779684,18896570,19013940,19131795,19250136,19368964,19488280,19608085,19728380,19849166,19970444,20092215,20214480,20337240,20460496,20584249,20708500,20833250,20958500,21084251,21210504,21337260,21464520,21592285,21720556,21849334,21978620,22108415,22238720,22369536,22500864,22632705,22765060,22897930,23031316,23165219,23299640,23434580,23570040,23706021,23842524,23979550,24117100,24255175,24393776,24532904,24672560,24812745,24953460,25094706,25236484,25378795,25521640,25665020,25808936,25953389,26098380,26243910,26389980,26536591,26683744,26831440,26979680,27128465,27277796,27427674,27578100,27729075,27880600,28032676,28185304,28338485,28492220,28646510,28801356,28956759,29112720,29269240,29426320,29583961,29742164,29900930,30060260,30220155,30380616,30541644,30703240,30865405,31028140,31191446,31355324,31519775,31684800,31850400,32016576,32183329,32350660,32518570,32687060,32856131,33025784,33196020,33366840,33538245,33710236,33882814,34055980,34229735,34404080,34579016,34754544,34930665,35107380,35284690,35462596,35641099,35820200,35999900,36180200,36361101,36542604,36724710,36907420,37090735,37274656,37459184,37644320,37830065,38016420,38203386,38390964,38579155,38767960,38957380,39147416,39338069,39529340,39721230,39913740,40106871,40300624,40495000,40690000,40885625,41081876,41278754,41476260,41674395,41873160,42072556,42272584,42473245,42674540,42876470,43079036,43282239,43486080,43690560,43895680,44101441,44307844,44514890,44722580,44930915,45139896,45349524,45559800,45770725,45982300,46194526,46407404,46620935,46835120,47049960,47265456,47481609,47698420,47915890,48134020,48352811,48572264,48792380,49013160,49234605,49456716,49679494,49902940,50127055,50351840,50577296,50803424,51030225,51257700,51485850,51714676,51944179,52174360,52405220,52636760,52868981,53101884,53335470,53569740,53804695,54040336,54276664,54513680,54751385,54989780,55228866,55468644,55709115,55950280,56192140,56434696,56677949,56921900,57166550,57411900,57657951,57904704,58152160,58400320,58649185,58898756,59149034,59400020,59651715,59904120,60157236,60411064,60665605,60920860,61176830,61433516,61690919,61949040,62207880,62467440,62727721,62988724,63250450,63512900,63776075,64039976,64304604,64569960,64836045,65102860,65370406,65638684,65907695,66177440,66447920,66719136,66991089,67263780,67537210,67811380,68086291,68361944,68638340,68915480,69193365,69471996,69751374,70031500,70312375,70594000,70876376,71159504,71443385,71728020,72013410,72299556,72586459,72874120,73162540,73451720,73741661,74032364,74323830,74616060,74909055,75202816,75497344,75792640,76088705,76385540,76683146,76981524,77280675,77580600,77881300,78182776,78485029,78788060,79091870,79396460,79701831,80007984,80314920,80622640,80931145,81240436,81550514,81861380,82173035,82485480,82798716,83112744,83427565,83743180,84059590,84376796,84694799,85013600,85333200,85653600,85974801,86296804,86619610,86943220,87267635,87592856,87918884,88245720,88573365,88901820,89231086,89561164,89892055,90223760,90556280,90889616,91223769,91558740,91894530,92231140,92568571,92906824,93245900,93585800,93926525,94268076,94610454,94953660,95297695,95642560,95988256,96334784,96682145,97030340,97379370,97729236,98079939,98431480,98783860,99137080,99491141,99846044,100201790,100558380,100915815,101274096,101633224,101993200,102354025,102715700,103078226,103441604,103805835,104170920,104536860,104903656,105271309,105639820,106009190,106379420,106750511,107122464,107495280,107868960,108243505,108618916,108995194,109372340,109750355,110129240,110508996,110889624,111271125,111653500,112036750,112420876,112805879,113191760,113578520,113966160,114354681,114744084,115134370,115525540,115917595,116310536,116704364,117099080,117494685,117891180,118288566,118686844,119086015,119486080,119887040,120288896,120691649,121095300,121499850,121905300,122311651,122718904,123127060,123536120,123946085,124356956,124768734,125181420,125595015,126009520,126424936,126841264,127258505,127676660,128095730,128515716,128936619,129358440,129781180,130204840,130629421,131054924,131481350,131908700,132336975,132766176,133196304,133627360,134059345,134492260,134926106,135360884,135796595,136233240,136670820,137109336,137548789,137989180,138430510,138872780,139315991,139760144,140205240,140651280,141098265,141546196,141995074,142444900,142895675,143347400,143800076,144253704,144708285,145163820,145620310,146077756,146536159,146995520,147455840,147917120,148379361,148842564,149306730,149771860,150237955,150705016,151173044,151642040,152112005,152582940,153054846,153527724,154001575,154476400,154952200,155428976,155906729,156385460,156865170,157345860,157827531,158310184,158793820,159278440,159764045,160250636,160738214,161226780,161716335,162206880,162698416,163190944,163684465,164178980,164674490,165170996,165668499,166167000,166666500,167167000,167668501,168171000,168674494,169178980,169684455,170190916,170698360,171206784,171716185,172226560,172737906,173250220,173763499,174277740,174792940,175309096,175826205,176344264,176863270,177383220,177904111,178425940,178948704,179472400,179997025,180522576,181049050,181576444,182104755,182633980,183164116,183695160,184227109,184759960,185293710,185828356,186363895,186900324,187437640,187975840,188514921,189054880,189595714,190137420,190679995,191223436,191767740,192312904,192858925,193405800,193953526,194502100,195051519,195601780,196152880,196704816,197257585,197811184,198365610,198920860,199476931,200033820,200591524,201150040,201709365,202269496,202830430,203392164,203954695,204518020,205082136,205647040,206212729,206779200,207346450,207914476,208483275,209052844,209623180,210194280,210766141,211338760,211912134,212486260,213061135,213636756,214213120,214790224,215368065,215946640,216525946,217105980,217686739,218268220,218850420,219433336,220016965,220601304,221186350,221772100,222358551,222945700,223533544,224122080,224711305,225301216,225891810,226483084,227075035,227667660,228260956,228854920,229449549,230044840,230640790,231237396,231834655,232432564,233031120,233630320,234230161,234830640,235431754,236033500,236635875,237238876,237842500,238446744,239051605,239657080,240263166,240869860,241477159,242085060,242693560,243302656,243912345,244522624,245133490,245744940,246356971,246969580,247582764,248196520,248810845,249425736,250041190,250657204,251273775,251890900,252508576,253126800,253745569,254364880,254984730,255605116,256226035,256847484,257469460,258091960,258714981,259338520,259962574,260587140,261212215,261837796,262463880,263090464,263717545,264345120,264973186,265601740,266230779,266860300,267490300,268120776,268751725,269383144,270015030,270647380,271280191,271913460,272547184,273181360,273815985,274451056,275086570,275722524,276358915,276995740,277632996,278270680,278908789,279547320,280186270,280825636,281465415,282105604,282746200,283387200,284028601,284670400,285312594,285955180,286598155,287241516,287885260,288529384,289173885,289818760,290464006,291109620,291755599,292401940,293048640,293695696,294343105,294990864,295638970,296287420,296936211,297585340,298234804,298884600,299534725,300185176,300835950,301487044,302138455,302790180,303442216,304094560,304747209,305400160,306053410,306706956,307360795,308014924,308669340,309324040,309979021,310634280,311289814,311945620,312601695,313258036,313914640,314571504,315228625,315886000,316543626,317201500,317859619,318517980,319176580,319835416,320494485,321153784,321813310,322473060,323133031,323793220,324453624,325114240,325775065,326436096,327097330,327758764,328420395,329082220,329744236,330406440,331068829,331731400,332394150,333057076,333720175,334383444,335046880,335710480,336374241,337038160,337702234,338366460,339030835,339695356,340360020,341024824,341689765,342354840,343020046,343685380,344350839,345016420,345682120,346347936,347013865,347679904,348346050,349012300,349678651,350345100,351011644,351678280,352345005,353011816,353678710,354345684,355012735,355679860,356347056,357014320,357681649,358349040,359016490,359683996,360351555,361019164,361686820,362354520,363022261,363690040,364357854,365025700,365693575,366361476,367029400,367697344,368365305,369033280,369701266,370369260,371037259,371705260,372373260,373041256,373709245,374377224,375045190,375713140,376381071,377048980,377716864,378384720,379052545,379720336,380388090,381055804,381723475,382391100,383058676,383726200,384393669,385061080,385728430,386395716,387062935,387730084,388397160,389064160,389731081,390397920,391064674,391731340,392397915,393064396,393730780,394397064,395063245,395729320,396395286,397061140,397726879,398392500,399058000,399723376,400388625,401053744,401718730,402383580,403048291,403712860,404377284,405041560,405705685,406369656,407033470,407697124,408360615,409023940,409687096,410350080,411012889,411675520,412337970,413000236,413662315,414324204,414985900,415647400,416308701,416969800,417630694,418291380,418951855,419612116,420272160,420931984,421591585,422250960,422910106,423569020,424227699,424886140,425544340,426202296,426860005,427517464,428174670,428831620,429488311,430144740,430800904,431456800,432112425,432767776,433422850,434077644,434732155,435386380,436040316,436693960,437347309,438000360,438653110,439305556,439957695,440609524,441261040,441912240,442563121,443213680,443863914,444513820,445163395,445812636,446461540,447110104,447758325,448406200,449053726,449700900,450347719,450994180,451640280,452286016,452931385,453576384,454221010,454865260,455509131,456152620,456795724,457438440,458080765,458722696,459364230,460005364,460646095,461286420,461926336,462565840,463204929,463843600,464481850,465119676,465757075,466394044,467030580,467666680,468302341,468937560,469572334,470206660,470840535,471473956,472106920,472739424,473371465,474003040,474634146,475264780,475894939,476524620,477153820,477782536,478410765,479038504,479665750,480292500,480918751,481544500,482169744,482794480,483418705,484042416,484665610,485288284,485910435,486532060,487153156,487773720,488393749,489013240,489632190,490250596,490868455,491485764,492102520,492718720,493334361,493949440,494563954,495177900,495791275,496404076,497016300,497627944,498239005,498849480,499459366,500068660,500677359,501285460,501892960,502499856,503106145,503711824,504316890,504921340,505525171,506128380,506730964,507332920,507934245,508534936,509134990,509734404,510333175,510931300,511528776,512125600,512721769,513317280,513912130,514506316,515099835,515692684,516284860,516876360,517467181,518057320,518646774,519235540,519823615,520410996,520997680,521583664,522168945,522753520,523337386,523920540,524502979,525084700,525665700,526245976,526825525,527404344,527982430,528559780,529136391,529712260,530287384,530861760,531435385,532008256,532580370,533151724,533722315,534292140,534861196,535429480,535996989,536563720,537129670,537694836,538259215,538822804,539385600,539947600,540508801,541069200,541628794,542187580,542745555,543302716,543859060,544414584,544969285,545523160,546076206,546628420,547179799,547730340,548280040,548828896,549376905,549924064,550470370,551015820,551560411,552104140,552647004,553189000,553730125,554270376,554809750,555348244,555885855,556422580,556958416,557493360,558027409,558560560,559092810,559624156,560154595,560684124,561212740,561740440,562267221,562793080,563318014,563842020,564365095,564887236,565408440,565928704,566448025,566966400,567483826,568000300,568515819,569030380,569543980,570056616,570568285,571078984,571588710,572097460,572605231,573112020,573617824,574122640,574626465,575129296,575631130,576131964,576631795,577130620,577628436,578125240,578621029,579115800,579609550,580102276,580593975,581084644,581574280,582062880,582550441,583036960,583522434,584006860,584490235,584972556,585453820,585934024,586413165,586891240,587368246,587844180,588319039,588792820,589265520,589737136,590207665,590677104,591145450,591612700,592078851,592543900,593007844,593470680,593932405,594393016,594852510,595310884,595768135,596224260,596679256,597133120,597585849,598037440,598487890,598937196,599385355,599832364,600278220,600722920,601166461,601608840,602050054,602490100,602928975,603366676,603803200,604238544,604672705,605105680,605537466,605968060,606397459,606825660,607252660,607678456,608103045,608526424,608948590,609369540,609789271,610207780,610625064,611041120,611455945,611869536,612281890,612693004,613102875,613511500,613918876,614325000,614729869,615133480,615535830,615936916,616336735,616735284,617132560,617528560,617923281,618316720,618708874,619099740,619489315,619877596,620264580,620650264,621034645,621417720,621799486,622179940,622559079,622936900,623313400,623688576,624062425,624434944,624806130,625175980,625544491,625911660,626277484,626641960,627005085,627366856,627727270,628086324,628444015,628800340,629155296,629508880,629861089,630211920,630561370,630909436,631256115,631601404,631945300,632287800,632628901,632968600,633306894,633643780,633979255,634313316,634645960,634977184,635306985,635635360,635962306,636287820,636611899,636934540,637255740,637575496,637893805,638210664,638526070,638840020,639152511,639463540,639773104,640081200,640387825,640692976,640996650,641298844,641599555,641898780,642196516,642492760,642787509,643080760,643372510,643662756,643951495,644238724,644524440,644808640,645091321,645372480,645652114,645930220,646206795,646481836,646755340,647027304,647297725,647566600,647833926,648099700,648363919,648626580,648887680,649147216,649405185,649661584,649916410,650169660,650421331,650671420,650919924,651166840,651412165,651655896,651898030,652138564,652377495,652614820,652850536,653084640,653317129,653548000,653777250,654004876,654230875,654455244,654677980,654899080,655118541,655336360,655552534,655767060,655979935,656191156,656400720,656608624,656814865,657019440,657222346,657423580,657623139,657821020,658017220,658211736,658404565,658595704,658785150,658972900,659158951,659343300,659525944,659706880,659886105,660063616,660239410,660413484,660585835,660756460,660925356,661092520,661257949,661421640,661583590,661743796,661902255,662058964,662213920,662367120,662518561,662668240,662816154,662962300,663106675,663249276,663390100,663529144,663666405,663801880,663935566,664067460,664197559,664325860,664452360,664577056,664699945,664821024,664940290,665057740,665173371,665287180,665399164,665509320,665617645,665724136,665828790,665931604,666032575,666131700,666228976,666324400,666417969,666509680,666599530,666687516,666773635,666857884,666940260,667020760,667099381,667176120,667250974,667323940,667395015,667464196,667531480,667596864,667660345,667721920,667781586,667839340,667895179,667949100,668001100,668051176,668099325,668145544,668189830,668232180,668272591,668311060,668347584,668382160,668414785,668445456,668474170,668500924,668525715,668548540,668569396,668588280,668605189,668620120,668633070,668644036,668653015,668660004,668665000,668668000,668669001};
  int n;
  while(scanf("%d",&n)!=EOF){
    if(n>=2000){
      n=4000-n;
    }
    printf("%d\n",table[n]);
  }
  return 0;
}



Measured memory_bytes: 2772