#include <bits/stdc++.h>
using namespace std;
map<string, pair<int, int> > ma;
int main() {
  ma["ABU"] = make_pair(1, 3);
  ma["AIDS"] = make_pair(3, 4);
  ma["Action"] = make_pair(3, 6);
  ma["Agreement"] = make_pair(3, 4);
  ma["Agriculture"] = make_pair(3, 7);
  ma["American"] = make_pair(3, 27);
  ma["Arab"] = make_pair(1, 13);
  ma["Armacost"] = make_pair(3, 3);
  ma["Assets"] = make_pair(2, 3);
  ma["Bahrain"] = make_pair(1, 7);
  ma["Baldrige"] = make_pair(3, 9);
  ma["Bangemann"] = make_pair(1, 5);
  ma["Bond"] = make_pair(1, 3);
  ma["Both"] = make_pair(3, 3);
  ma["Bouldikian"] = make_pair(1, 3);
  ma["Brien"] = make_pair(3, 4);
  ma["Broadly"] = make_pair(2, 3);
  ma["Byrd"] = make_pair(3, 5);
  ma["CDs"] = make_pair(2, 7);
  ma["Cable"] = make_pair(3, 3);
  ma["Chartered"] = make_pair(2, 6);
  ma["Chicago"] = make_pair(2, 3);
  ma["Chirac"] = make_pair(3, 10);
  ma["Clark"] = make_pair(3, 3);
  ma["Clayton"] = make_pair(3, 4);
  ma["Clercq"] = make_pair(3, 8);
  ma["Commerce"] = make_pair(3, 5);
  ma["Commission"] = make_pair(3, 3);
  ma["Conable"] = make_pair(3, 5);
  ma["Congress"] = make_pair(3, 20);
  ma["Congressmen"] = make_pair(3, 5);
  ma["Croo"] = make_pair(3, 5);
  ma["DHABI"] = make_pair(1, 3);
  ma["DRAM"] = make_pair(3, 5);
  ma["Dattel"] = make_pair(1, 3);
  ma["Dealers"] = make_pair(1, 11);
  ma["Democrat"] = make_pair(3, 3);
  ma["Democratic"] = make_pair(3, 11);
  ma["Department"] = make_pair(3, 4);
  ma["Deputy"] = make_pair(3, 3);
  ma["Development"] = make_pair(3, 3);
  ma["ECGD"] = make_pair(3, 3);
  ma["EEP"] = make_pair(3, 7);
  ma["Economic"] = make_pair(3, 8);
  ma["Edwards"] = make_pair(3, 5);
  ma["Electric"] = make_pair(3, 3);
  ma["Electronic"] = make_pair(3, 3);
  ma["Europe"] = make_pair(3, 8);
  ma["FECs"] = make_pair(1, 6);
  ma["FOMC"] = make_pair(2, 8);
  ma["FSO"] = make_pair(3, 6);
  ma["Faced"] = make_pair(3, 3);
  ma["Fitzwater"] = make_pair(3, 3);
  ma["Fleming"] = make_pair(3, 3);
  ma["GATT"] = make_pair(3, 17);
  ma["General"] = make_pair(3, 5);
  ma["Giordano"] = make_pair(1, 8);
  ma["Gulf"] = make_pair(1, 4);
  ma["Heller"] = make_pair(1, 4);
  ma["Herstatt"] = make_pair(1, 4);
  ma["Hitachi"] = make_pair(3, 3);
  ma["Horner"] = make_pair(1, 5);
  ma["IDB"] = make_pair(3, 4);
  ma["India"] = make_pair(3, 10);
  ma["Indian"] = make_pair(3, 5);
  ma["Industries"] = make_pair(3, 3);
  ma["Islamic"] = make_pair(3, 4);
  ma["Jardine"] = make_pair(3, 3);
  ma["Johnson"] = make_pair(2, 3);
  ma["July"] = make_pair(3, 4);
  ma["Kyodo"] = make_pair(3, 4);
  ma["LDP"] = make_pair(3, 11);
  ma["Leader"] = make_pair(3, 3);
  ma["Lebanese"] = make_pair(1, 5);
  ma["Liberal"] = make_pair(3, 3);
  ma["Local"] = make_pair(2, 3);
  ma["London"] = make_pair(3, 11);
  ma["Lyng"] = make_pair(3, 3);
  ma["MITI"] = make_pair(3, 17);
  ma["MMTC"] = make_pair(3, 3);
  ma["MPs"] = make_pair(3, 4);
  ma["Malcolm"] = make_pair(3, 4);
  ma["Margaret"] = make_pair(3, 3);
  ma["Matsunaga"] = make_pair(3, 5);
  ma["McCarthy"] = make_pair(2, 3);
  ma["Melzer"] = make_pair(2, 3);
  ma["Miller"] = make_pair(3, 3);
  ma["Most"] = make_pair(3, 3);
  ma["NEC"] = make_pair(3, 6);
  ma["Nakasone"] = make_pair(3, 47);
  ma["Nashashibi"] = make_pair(1, 3);
  ma["News"] = make_pair(3, 4);
  ma["Notes"] = make_pair(2, 3);
  ma["November"] = make_pair(2, 22);
  ma["OTTAWA"] = make_pair(2, 4);
  ma["Officials"] = make_pair(3, 5);
  ma["PHLX"] = make_pair(1, 10);
  ma["PSL"] = make_pair(2, 3);
  ma["Partly"] = make_pair(1, 3);
  ma["Party"] = make_pair(3, 3);
  ma["Philadelphia"] = make_pair(1, 4);
  ma["Plaza"] = make_pair(1, 4);
  ma["Policy"] = make_pair(3, 8);
  ma["Prime"] = make_pair(3, 17);
  ma["Representative"] = make_pair(3, 3);
  ma["Republican"] = make_pair(3, 7);
  ma["Rich"] = make_pair(3, 3);
  ma["Richard"] = make_pair(3, 4);
  ma["Ronald"] = make_pair(3, 4);
  ma["Rostenkowski"] = make_pair(3, 3);
  ma["Russell"] = make_pair(2, 4);
  ma["Ryzhkov"] = make_pair(3, 4);
  ma["Saba"] = make_pair(3, 6);
  ma["Savings"] = make_pair(2, 3);
  ma["Senate"] = make_pair(3, 9);
  ma["Service"] = make_pair(3, 3);
  ma["Shiratori"] = make_pair(3, 3);
  ma["Shoichi"] = make_pair(3, 3);
  ma["Smart"] = make_pair(3, 5);
  ma["Stephens"] = make_pair(3, 5);
  ma["Sumita"] = make_pair(1, 6);
  ma["Tamura"] = make_pair(3, 4);
  ma["Tariffs"] = make_pair(3, 8);
  ma["Thatcher"] = make_pair(3, 4);
  ma["Their"] = make_pair(3, 4);
  ma["Third"] = make_pair(3, 5);
  ma["Though"] = make_pair(1, 3);
  ma["Tian"] = make_pair(1, 4);
  ma["Toshiba"] = make_pair(3, 4);
  ma["Vice"] = make_pair(1, 5);
  ma["Volcker"] = make_pair(2, 3);
  ma["Washington"] = make_pair(3, 38);
  ma["While"] = make_pair(3, 7);
  ma["White"] = make_pair(3, 12);
  ma["Willy"] = make_pair(3, 3);
  ma["Wireless"] = make_pair(3, 3);
  ma["Wolf"] = make_pair(3, 5);
  ma["World"] = make_pair(3, 9);
  ma["Wright"] = make_pair(3, 3);
  ma["Yasuhiro"] = make_pair(3, 12);
  ma["Yeutter"] = make_pair(3, 11);
  ma["abide"] = make_pair(3, 3);
  ma["able"] = make_pair(1, 3);
  ma["acceptances"] = make_pair(2, 10);
  ma["acquisition"] = make_pair(3, 3);
  ma["act"] = make_pair(3, 8);
  ma["add"] = make_pair(1, 4);
  ma["adverse"] = make_pair(3, 3);
  ma["aggregate"] = make_pair(2, 4);
  ma["aggregates"] = make_pair(2, 6);
  ma["agricultural"] = make_pair(3, 3);
  ma["alleged"] = make_pair(3, 13);
  ma["amendment"] = make_pair(3, 3);
  ma["amounts"] = make_pair(1, 4);
  ma["anger"] = make_pair(3, 4);
  ma["angry"] = make_pair(3, 4);
  ma["announcement"] = make_pair(3, 3);
  ma["annualised"] = make_pair(2, 5);
  ma["annualized"] = make_pair(2, 5);
  ma["anti"] = make_pair(3, 3);
  ma["application"] = make_pair(3, 5);
  ma["areas"] = make_pair(3, 5);
  ma["assistance"] = make_pair(1, 14);
  ma["attempt"] = make_pair(3, 4);
  ma["auto"] = make_pair(3, 3);
  ma["averaged"] = make_pair(2, 4);
  ma["band"] = make_pair(1, 9);
  ma["bankers"] = make_pair(1, 5);
  ma["barriers"] = make_pair(3, 6);
  ma["bearing"] = make_pair(2, 4);
  ma["bilateral"] = make_pair(3, 12);
  ma["booked"] = make_pair(2, 4);
  ma["books"] = make_pair(2, 5);
  ma["borrowings"] = make_pair(2, 8);
  ma["bringing"] = make_pair(2, 3);
  ma["broader"] = make_pair(2, 3);
  ma["car"] = make_pair(3, 4);
  ma["carefully"] = make_pair(1, 4);
  ma["cause"] = make_pair(3, 3);
  ma["cent"] = make_pair(3, 3);
  ma["certain"] = make_pair(3, 5);
  ma["chance"] = make_pair(3, 5);
  ma["changed"] = make_pair(2, 3);
  ma["chartered"] = make_pair(2, 7);
  ma["chequable"] = make_pair(2, 4);
  ma["chip"] = make_pair(3, 30);
  ma["chips"] = make_pair(3, 21);
  ma["circular"] = make_pair(1, 3);
  ma["claims"] = make_pair(3, 3);
  ma["closely"] = make_pair(1, 4);
  ma["coins"] = make_pair(2, 4);
  ma["come"] = make_pair(3, 14);
  ma["comment"] = make_pair(1, 4);
  ma["committed"] = make_pair(1, 4);
  ma["commodity"] = make_pair(1, 11);
  ma["common"] = make_pair(1, 3);
  ma["company"] = make_pair(3, 7);
  ma["compares"] = make_pair(1, 5);
  ma["computer"] = make_pair(3, 16);
  ma["concerned"] = make_pair(3, 4);
  ma["concerns"] = make_pair(3, 3);
  ma["conciliatory"] = make_pair(3, 4);
  ma["confident"] = make_pair(3, 3);
  ma["considering"] = make_pair(3, 3);
  ma["consultations"] = make_pair(3, 4);
  ma["contract"] = make_pair(1, 4);
  ma["contractionary"] = make_pair(2, 3);
  ma["contracts"] = make_pair(1, 5);
  ma["controls"] = make_pair(1, 8);
  ma["convince"] = make_pair(3, 5);
  ma["cooperate"] = make_pair(1, 3);
  ma["counter"] = make_pair(1, 4);
  ma["countertrade"] = make_pair(3, 7);
  ma["cross"] = make_pair(3, 3);
  ma["curbs"] = make_pair(3, 6);
  ma["currencies"] = make_pair(1, 24);
  ma["customer"] = make_pair(1, 3);
  ma["date"] = make_pair(3, 3);
  ma["deal"] = make_pair(3, 3);
  ma["dealers"] = make_pair(1, 16);
  ma["deals"] = make_pair(3, 4);
  ma["defined"] = make_pair(2, 9);
  ma["defuse"] = make_pair(3, 3);
  ma["developed"] = make_pair(3, 3);
  ma["difficult"] = make_pair(3, 5);
  ma["dinar"] = make_pair(1, 3);
  ma["directive"] = make_pair(2, 3);
  ma["discuss"] = make_pair(3, 3);
  ma["dispute"] = make_pair(3, 24);
  ma["doing"] = make_pair(3, 4);
  ma["dollars"] = make_pair(1, 8);
  ma["downwards"] = make_pair(2, 3);
  ma["dumping"] = make_pair(3, 16);
  ma["duties"] = make_pair(3, 6);
  ma["eased"] = make_pair(1, 3);
  ma["efforts"] = make_pair(3, 7);
  ma["elected"] = make_pair(1, 3);
  ma["elections"] = make_pair(3, 3);
  ma["electronic"] = make_pair(3, 14);
  ma["electronics"] = make_pair(3, 8);
  ma["emphasis"] = make_pair(3, 3);
  ma["ensure"] = make_pair(3, 4);
  ma["estimate"] = make_pair(1, 7);
  ma["exchequer"] = make_pair(1, 3);
  ma["excluding"] = make_pair(2, 6);
  ma["expanding"] = make_pair(3, 5);
  ma["expectations"] = make_pair(2, 3);
  ma["export"] = make_pair(3, 10);
  ma["expressed"] = make_pair(3, 3);
  ma["extended"] = make_pair(2, 4);
  ma["fallen"] = make_pair(1, 3);
  ma["fear"] = make_pair(3, 3);
  ma["figure"] = make_pair(2, 5);
  ma["final"] = make_pair(3, 6);
  ma["fire"] = make_pair(3, 3);
  ma["float"] = make_pair(2, 6);
  ma["focus"] = make_pair(3, 5);
  ma["forced"] = make_pair(3, 4);
  ma["foster"] = make_pair(1, 5);
  ma["foundation"] = make_pair(3, 3);
  ma["friction"] = make_pair(3, 4);
  ma["fund"] = make_pair(1, 4);
  ma["futures"] = make_pair(1, 4);
  ma["gold"] = make_pair(1, 5);
  ma["goods"] = make_pair(3, 33);
  ma["group"] = make_pair(3, 3);
  ma["guilders"] = make_pair(2, 3);
  ma["hand"] = make_pair(1, 4);
  ma["hard"] = make_pair(3, 5);
  ma["hearing"] = make_pair(3, 5);
  ma["heated"] = make_pair(3, 4);
  ma["hedging"] = make_pair(1, 6);
  ma["hope"] = make_pair(3, 6);
  ma["hoped"] = make_pair(3, 3);
  ma["house"] = make_pair(1, 3);
  ma["how"] = make_pair(3, 3);
  ma["huge"] = make_pair(3, 8);
  ma["implement"] = make_pair(3, 3);
  ma["import"] = make_pair(3, 7);
  ma["important"] = make_pair(3, 3);
  ma["impose"] = make_pair(3, 15);
  ma["imposed"] = make_pair(3, 4);
  ma["imposing"] = make_pair(3, 3);
  ma["include"] = make_pair(3, 10);
  ma["index"] = make_pair(1, 3);
  ma["industrialized"] = make_pair(1, 3);
  ma["industries"] = make_pair(3, 4);
  ma["intend"] = make_pair(1, 3);
  ma["interbank"] = make_pair(1, 3);
  ma["interests"] = make_pair(3, 3);
  ma["investigation"] = make_pair(3, 4);
  ma["irrational"] = make_pair(3, 3);
  ma["island"] = make_pair(1, 3);
  ma["issue"] = make_pair(3, 11);
  ma["join"] = make_pair(3, 4);
  ma["joint"] = make_pair(3, 9);
  ma["keep"] = make_pair(3, 3);
  ma["kind"] = make_pair(3, 3);
  ma["leaders"] = make_pair(3, 5);
  ma["legislation"] = make_pair(3, 8);
  ma["liabilities"] = make_pair(2, 3);
  ma["licences"] = make_pair(3, 4);
  ma["list"] = make_pair(3, 4);
  ma["live"] = make_pair(3, 10);
  ma["look"] = make_pair(3, 4);
  ma["loss"] = make_pair(3, 3);
  ma["makers"] = make_pair(3, 12);
  ma["manufacturers"] = make_pair(3, 3);
  ma["maturing"] = make_pair(1, 3);
  ma["memory"] = make_pair(3, 4);
  ma["microchip"] = make_pair(3, 7);
  ma["microchips"] = make_pair(3, 11);
  ma["minimum"] = make_pair(1, 3);
  ma["minus"] = make_pair(2, 3);
  ma["minutes"] = make_pair(2, 4);
  ma["missiles"] = make_pair(3, 3);
  ma["morning"] = make_pair(1, 7);
  ma["moves"] = make_pair(3, 4);
  ma["narrowly"] = make_pair(2, 4);
  ma["newly"] = make_pair(1, 3);
  ma["normally"] = make_pair(1, 3);
  ma["offers"] = make_pair(1, 3);
  ma["offsetting"] = make_pair(1, 3);
  ma["opened"] = make_pair(3, 4);
  ma["opposition"] = make_pair(3, 4);
  ma["output"] = make_pair(3, 8);
  ma["outstanding"] = make_pair(2, 9);
  ma["package"] = make_pair(3, 4);
  ma["packages"] = make_pair(3, 4);
  ma["parliament"] = make_pair(3, 3);
  ma["parties"] = make_pair(3, 5);
  ma["parts"] = make_pair(3, 6);
  ma["passed"] = make_pair(3, 5);
  ma["per"] = make_pair(3, 5);
  ma["persuade"] = make_pair(3, 5);
  ma["pesos"] = make_pair(2, 9);
  ma["planned"] = make_pair(3, 4);
  ma["pledged"] = make_pair(3, 4);
  ma["plus"] = make_pair(2, 19);
  ma["polled"] = make_pair(2, 4);
  ma["power"] = make_pair(3, 4);
  ma["practices"] = make_pair(3, 6);
  ma["predicted"] = make_pair(3, 3);
  ma["pressing"] = make_pair(1, 3);
  ma["products"] = make_pair(3, 17);
  ma["programme"] = make_pair(1, 3);
  ma["projections"] = make_pair(2, 4);
  ma["proposal"] = make_pair(3, 3);
  ma["propose"] = make_pair(3, 7);
  ma["provided"] = make_pair(1, 9);
  ma["provisional"] = make_pair(2, 22);
  ma["purchased"] = make_pair(1, 4);
  ma["quickly"] = make_pair(3, 4);
  ma["ranges"] = make_pair(1, 3);
  ma["react"] = make_pair(3, 4);
  ma["ready"] = make_pair(3, 3);
  ma["recommendation"] = make_pair(3, 3);
  ma["recommendations"] = make_pair(3, 5);
  ma["reform"] = make_pair(3, 3);
  ma["regret"] = make_pair(3, 3);
  ma["relations"] = make_pair(3, 3);
  ma["relationship"] = make_pair(3, 4);
  ma["replied"] = make_pair(3, 4);
  ma["report"] = make_pair(3, 10);
  ma["request"] = make_pair(3, 3);
  ma["resist"] = make_pair(3, 3);
  ma["resolve"] = make_pair(3, 4);
  ma["restraint"] = make_pair(2, 4);
  ma["restrictions"] = make_pair(3, 3);
  ma["retaliate"] = make_pair(3, 8);
  ma["retaliation"] = make_pair(3, 19);
  ma["retaliatory"] = make_pair(3, 8);
  ma["round"] = make_pair(1, 4);
  ma["row"] = make_pair(3, 7);
  ma["ruling"] = make_pair(3, 3);
  ma["run"] = make_pair(3, 3);
  ma["sanctions"] = make_pair(3, 26);
  ma["says"] = make_pair(1, 7);
  ma["seasonal"] = make_pair(2, 3);
  ma["secretary"] = make_pair(3, 3);
  ma["see"] = make_pair(3, 4);
  ma["sell"] = make_pair(3, 4);
  ma["semiconductor"] = make_pair(3, 33);
  ma["semiconductors"] = make_pair(3, 23);
  ma["send"] = make_pair(3, 5);
  ma["separate"] = make_pair(3, 5);
  ma["serious"] = make_pair(3, 3);
  ma["serve"] = make_pair(1, 6);
  ma["services"] = make_pair(3, 9);
  ma["sessions"] = make_pair(1, 3);
  ma["settle"] = make_pair(3, 6);
  ma["settlement"] = make_pair(3, 6);
  ma["she"] = make_pair(3, 8);
  ma["shipments"] = make_pair(3, 3);
  ma["sight"] = make_pair(2, 5);
  ma["signed"] = make_pair(3, 10);
  ma["significantly"] = make_pair(3, 3);
  ma["slash"] = make_pair(3, 3);
  ma["smallest"] = make_pair(2, 3);
  ma["something"] = make_pair(3, 4);
  ma["soon"] = make_pair(3, 5);
  ma["source"] = make_pair(3, 3);
  ma["specific"] = make_pair(3, 5);
  ma["speech"] = make_pair(3, 3);
  ma["spokeswoman"] = make_pair(3, 3);
  ma["stability"] = make_pair(1, 6);
  ma["steady"] = make_pair(2, 3);
  ma["steep"] = make_pair(1, 3);
  ma["step"] = make_pair(3, 4);
  ma["steps"] = make_pair(3, 3);
  ma["stop"] = make_pair(3, 11);
  ma["stopped"] = make_pair(3, 5);
  ma["strengthen"] = make_pair(1, 3);
  ma["studying"] = make_pair(3, 3);
  ma["success"] = make_pair(3, 4);
  ma["summer"] = make_pair(3, 3);
  ma["sure"] = make_pair(3, 6);
  ma["survey"] = make_pair(1, 3);
  ma["technology"] = make_pair(3, 5);
  ma["television"] = make_pair(3, 3);
  ma["tell"] = make_pair(3, 3);
  ma["test"] = make_pair(3, 4);
  ma["textile"] = make_pair(3, 6);
  ma["textiles"] = make_pair(3, 3);
  ma["thus"] = make_pair(2, 3);
  ma["tied"] = make_pair(1, 3);
  ma["totalled"] = make_pair(2, 6);
  ma["tough"] = make_pair(3, 3);
  ma["trader"] = make_pair(1, 3);
  ma["transactions"] = make_pair(1, 6);
  ma["tried"] = make_pair(3, 3);
  ma["trip"] = make_pair(3, 8);
  ma["try"] = make_pair(3, 11);
  ma["trying"] = make_pair(3, 4);
  ma["unadjusted"] = make_pair(2, 5);
  ma["unchanged"] = make_pair(2, 6);
  ma["underlying"] = make_pair(1, 4);
  ma["unfair"] = make_pair(3, 7);
  ma["urge"] = make_pair(3, 3);
  ma["violating"] = make_pair(3, 3);
  ma["visit"] = make_pair(3, 14);
  ma["volume"] = make_pair(3, 3);
  ma["voted"] = make_pair(2, 3);
  ma["ward"] = make_pair(3, 3);
  ma["warned"] = make_pair(3, 3);
  ma["warning"] = make_pair(3, 3);
  ma["weakened"] = make_pair(3, 3);
  ma["willing"] = make_pair(3, 4);
  ma["yield"] = make_pair(1, 3);
  ma["yields"] = make_pair(1, 3);
  string s;
  int a[4];
  memset(a, 0, sizeof a);
  while (cin >> s) {
    if (ma.find(s) != ma.end()) {
      a[ma[s].first] += ma[s].second;
    }
  }
  int m = max(max(a[1], a[2]), a[3]);
  if (a[1] == m) {
    cout << 1 << endl;
  } else {
    if (a[2] == m) {
      cout << 2 << endl;
    } else {
      cout << 3 << endl;
    }
  }
  return 0;
}
