#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:200000000")
const double EPS = 1E-9;
const int INF = 1000000000;
const long long INF64 = (long long)1E18;
const double PI = 3.1415926535897932384626433832795;
const int C = 100;
const string DELIMS = ",.?!\"\\/|#��@*";
const string cat[3 * C] = {
    "dealers 0.0038157536113382394",
    "customer 0.0010902153175252113",
    "dealer 9.539384028345599E-4",
    "of 0.034750613246116106",
    "given 0.0012264922322158627",
    "futures 8.176614881439084E-4",
    "among 0.0012264922322158627",
    "says 0.0014990460615971655",
    "bought 0.001635322976287817",
    "central 0.0035431997819569366",
    "exchange 0.006677568819841918",
    "option 0.0017715998909784683",
    "sold 9.539384028345599E-4",
    "these 0.0014990460615971655",
    "serve 9.539384028345599E-4",
    "liquidity 0.0028618152085036794",
    "compares 8.176614881439084E-4",
    "fecs 8.176614881439084E-4",
    "hours 0.0012264922322158627",
    "lebanese 9.539384028345599E-4",
    "he 0.009539384028345598",
    "system 0.003679476696647588",
    "funds 0.0023167075497410737",
    "london 0.0021804306350504225",
    "session 8.176614881439084E-4",
    "herstatt 8.176614881439084E-4",
    "low 0.001362769146906514",
    "bills 0.0046334150994821474",
    "offered 8.176614881439084E-4",
    "arab 0.002044153720359771",
    "assistance 0.002725538293813028",
    "bahrain 0.0012264922322158627",
    "estimate 0.0010902153175252113",
    "currency 0.006541291905151268",
    "paris 0.0017715998909784683",
    "life 8.176614881439084E-4",
    "intervention 0.002044153720359771",
    "bundesbank 0.001635322976287817",
    "dollar 0.006268738075769964",
    "contracts 8.176614881439084E-4",
    "gold 8.176614881439084E-4",
    "trading 0.002725538293813028",
    "100 8.176614881439084E-4",
    "options 0.0012264922322158627",
    "shortage 0.0019078768056691197",
    "dollars 0.0017715998909784683",
    "foster 8.176614881439084E-4",
    "rates 0.0028618152085036794",
    "philadelphia 9.539384028345599E-4",
    "morning 0.0010902153175252113",
    "bangemann 9.539384028345599E-4",
    "yen 0.0019078768056691197",
    "hedging 9.539384028345599E-4",
    "banks 0.004088307440719542",
    "transactions 9.539384028345599E-4",
    "investors 0.0010902153175252113",
    "marks 0.0014990460615971655",
    "horner 8.176614881439084E-4",
    "though 8.176614881439084E-4",
    "appropriations 8.176614881439084E-4",
    "band 0.001362769146906514",
    "giordano 0.0012264922322158627",
    "survey 8.176614881439084E-4",
    "bank 0.011447260834014717",
    "fund 9.539384028345599E-4",
    "had 0.006268738075769964",
    "stg 0.008176614881439084",
    "repurchase 0.0012264922322158627",
    "far 0.001635322976287817",
    "market 0.009266830198964295",
    "monetary 0.003134369037884982",
    "treasury 0.004905968928863451",
    "foreign 0.004497138184791497",
    "early 0.0024529844644317253",
    "currencies 0.003270645952575634",
    "carefully 9.539384028345599E-4",
    "have 0.00585990733169801",
    "stability 0.0012264922322158627",
    "today 0.0042245843554101934",
    "purchase 9.539384028345599E-4",
    "bond 0.0017715998909784683",
    "phlx 0.0012264922322158627",
    "controls 0.001362769146906514",
    "england 0.0023167075497410737",
    "traded 0.0012264922322158627",
    "baker 0.0021804306350504225",
    "houses 9.539384028345599E-4",
    "forecast 0.0014990460615971655",
    "148 8.176614881439084E-4",
    "agency 9.539384028345599E-4",
    "the 0.07849550286181521",
    "000 8.176614881439084E-4",
    "needed 0.0012264922322158627",
    "around 0.003270645952575634",
    "commodity 0.0019078768056691197",
    "continue 0.001362769146906514",
    "prices 0.0023167075497410737",
    "provided 0.001362769146906514",
    "sumita 0.0012264922322158627",
    "their 0.003679476696647588",
    "fell 0.007989347536617843",
    "deposit 0.0018157608037767826",
    "aggregates 8.473550417624985E-4",
    "deposits 0.0039946737683089215",
    "float 8.473550417624985E-4",
    "compared 0.0037525723278053506",
    "m-1 0.0070209417746035585",
    "m-2 0.0037525723278053506",
    "year 0.007141992494855344",
    "m-3 0.002905217286042852",
    "seasonally 0.002178912964532139",
    "plus 0.00242101440503571",
    "defined 8.473550417624985E-4",
    "loan 0.0013315579227696406",
    "excluding 8.473550417624985E-4",
    "3 0.007141992494855344",
    "rose 0.013315579227696404",
    "2 0.005689383851833919",
    "1 0.010168260501149981",
    "fed 0.003873623048057136",
    "0 0.004720978089819634",
    "acceptances 0.0013315579227696406",
    "7 0.004599927369567849",
    "february 0.008715651858128556",
    "6 0.005568333131582133",
    "feb 0.001452608643021426",
    "738 9.68405762014284E-4",
    "5 0.0059314852923374895",
    "4 0.007505144655610701",
    "1985 0.0025420651252874953",
    "canadian 0.0018157608037767826",
    "reserve 0.00484202881007142",
    "9 0.004115724488560707",
    "8 0.004720978089819634",
    "adjusted 0.002905217286042852",
    "chartered 0.001694710083524997",
    "broad 9.68405762014284E-4",
    "19 0.0013315579227696406",
    "data 0.0020578622442803535",
    "18 0.0015736593632732115",
    "16 0.00242101440503571",
    "savings 0.001452608643021426",
    "13 0.0022999636847839244",
    "net 0.0015736593632732115",
    "11 0.0015736593632732115",
    "12 0.0018157608037767826",
    "grew 0.001694710083524997",
    "money 0.011499818423919622",
    "rises 0.0020578622442803535",
    "year-on-year 0.0022999636847839244",
    "end 0.003147318726546423",
    "previous 0.0025420651252874953",
    "loans 0.003147318726546423",
    "10 0.0022999636847839244",
    "reserves 0.0020578622442803535",
    "notes 0.0010894564822660695",
    "week 0.005810434572085704",
    "sector 0.0015736593632732115",
    "unadjusted 8.473550417624985E-4",
    "ended 0.002905217286042852",
    "mln 0.011136666263164266",
    "pct 0.026752209175644595",
    "january 0.009320905459387484",
    "bank 0.010894564822660695",
    "november 0.0027841665657910666",
    "canada 0.001452608643021426",
    "billion 0.03462050599201065",
    "m-1-a 0.0010894564822660695",
    "m1 9.68405762014284E-4",
    "m2 0.0010894564822660695",
    "unchanged 9.68405762014284E-4",
    "m3 0.0013315579227696406",
    "dlrs 0.02747851349715531",
    "statement 0.0020578622442803535",
    "december 0.008957753298632127",
    "assets 0.002178912964532139",
    "revised 0.0022999636847839244",
    "cash 0.0013315579227696406",
    "74 0.0010894564822660695",
    "provisional 0.0027841665657910666",
    "measure 0.001694710083524997",
    "pesos 0.001210507202517855",
    "from 0.012468224185933907",
    "singapore 0.0015736593632732115",
    "federal 0.003147318726546423",
    "non-personal 0.0010894564822660695",
    "circulation 0.001452608643021426",
    "rise 0.00484202881007142",
    "borrowings 0.0013315579227696406",
    "64 8.473550417624985E-4",
    "supply 0.008473550417624985",
    "york 0.0020578622442803535",
    "outstanding 0.0013315579227696406",
    "economists 0.0020578622442803535",
    "in 0.039462534802082075",
    "balances 0.0022999636847839244",
    "fomc 0.001210507202517855",
    "wednesday 0.0013315579227696406",
    "average 0.002178912964532139",
    "growth 0.005568333131582133",
    "tariffs 0.0037952133839361784",
    "president 0.0021686933622492447",
    "they 0.004492293393230579",
    "nakasone 0.003562853380838045",
    "visit 0.0015490666873208892",
    "impose 0.0013941600185888002",
    "house 0.002401053365347378",
    "countries 0.0022461466966152894",
    "production 0.0015490666873208892",
    "miti 9.294400123925335E-4",
    "washington 0.004647200061962667",
    "over 0.0027883200371776004",
    "china's 7.745333436604446E-4",
    "are 0.004492293393230579",
    "report 8.51986678026489E-4",
    "industry 0.0021686933622492447",
    "bilateral 0.001006893346758578",
    "exports 0.0026334133684455118",
    "services 9.294400123925335E-4",
    "minister 0.0021686933622492447",
    "sanctions 0.0022461466966152894",
    "row 0.001006893346758578",
    "include 8.51986678026489E-4",
    "prime 0.0014716133529548447",
    "european 0.0013941600185888002",
    "dumping 0.0011618000154906669",
    "reagan 0.0036403067152040894",
    "semiconductors 0.0020912400278832004",
    "will 0.005421733405623112",
    "boost 0.0010843466811246223",
    "try 9.294400123925335E-4",
    "we 0.0031755867090078227",
    "computer 0.0013167066842227559",
    "plans 0.0017814266904190225",
    "analysts 0.001703973356052978",
    "europe 7.745333436604446E-4",
    "next 0.001703973356052978",
    "nakasone's 7.745333436604446E-4",
    "states 0.004182480055766401",
    "alleged 0.0010843466811246223",
    "ec 0.0021686933622492447",
    "de 0.0011618000154906669",
    "american 0.0016265200216869337",
    "do 0.0019363333591511116",
    "products 0.0013941600185888002",
    "microchip 8.51986678026489E-4",
    "chips 0.001858880024785067",
    "united 0.004182480055766401",
    "signed 8.51986678026489E-4",
    "officials 0.004337386724498489",
    "come 0.0011618000154906669",
    "electronic 0.0013941600185888002",
    "imports 0.003872666718302223",
    "u 0.01510340020137867",
    "s 0.014871040198280536",
    "world 0.0026334133684455118",
    "to 0.049182867322438234",
    "congress 0.001703973356052978",
    "countertrade 7.745333436604446E-4",
    "has 0.004569746727596623",
    "semiconductor 0.002555960034079467",
    "-japan 9.294400123925335E-4",
    "his 0.0023236000309813337",
    "would 0.007435520099140268",
    "microchips 9.294400123925335E-4",
    "action 0.002401053365347378",
    "tokyo 0.002710866702811556",
    "official 0.0034854000464720008",
    "live 8.51986678026489E-4",
    "300 0.0011618000154906669",
    "dispute 0.002401053365347378",
    "white 0.0012392533498567114",
    "japanese 0.009139493455193246",
    "that 0.011695453489272712",
    "retaliation 0.001703973356052978",
    "failure 0.0011618000154906669",
    "pact 0.0020912400278832004",
    "japan's 0.002710866702811556",
    "makers 0.0010843466811246223",
    "talks 0.0015490666873208892",
    "output 7.745333436604446E-4",
    "administration 7.745333436604446E-4",
    "gatt 0.0010843466811246223",
    "stop 0.0010843466811246223",
    "trade 0.019595693594609248",
    "issue 9.294400123925335E-4",
    "goods 0.002710866702811556",
    "baldrige 0.001006893346758578",
    "chirac 8.51986678026489E-4",
    "war 0.0027883200371776004",
    "japan 0.009914026798853691",
    "chip 0.002865773371543645",
    "is 0.008364960111532802",
    "export 8.51986678026489E-4",
    "agreement 0.0033304933777399117",
    "expected 0.0014716133529548447",
    "yeutter 0.0010843466811246223",
    "democratic 9.294400123925335E-4",
    "act 8.51986678026489E-4",
    "yasuhiro 0.001006893346758578",
};
char buf[1100000];
map<string, double> ma[3];
double p[10];
int sel;
int main() {
  for (int i = 0; i < (int)(3 * C); i++) {
    double x;
    sscanf(cat[i].c_str(), "%s%lf", buf, &x);
    ma[i / C][buf] = x;
  }
  gets(buf);
  string text;
  while (gets(buf)) {
    text += buf;
    text += ' ';
  }
  for (int i = 0; i < (int)(text.size()); i++)
    if (DELIMS.find(text[i]) != string::npos) text[i] = ' ';
  stringstream ss;
  ss << text;
  string tok;
  while (ss >> tok) {
    for (int i = 0; i < (int)(tok.size()); i++) tok[i] = tolower(tok[i]);
    for (int i = 0; i < (int)(3); i++)
      if (ma[i].count(tok))
        p[i] += log(ma[i][tok]);
      else
        p[i] += log(1E-6);
  }
  sel = 1;
  for (int i = (int)(3) - 1; i >= 0; i--)
    if (p[i] > p[sel] + EPS) sel = i;
  cout << sel + 1 << endl;
  return 0;
}
