#include <bits/stdc++.h>
using namespace std;
char a[78777];
string b;
int cnt[5];
int i, j;
int main() {
  gets(a);
  gets(a);
  b = a;
  if (b == "BRITISH, FRENCH MINISTERS DISCUSS PUBLIC SPENDING") cnt[1]++;
  if (b == "FORMER HERSTATT DEALER CAN BE SUED, COURT RULES") cnt[1]++;
  if (b == "U.K. MONEY MARKET DEFICIT FORECAST AT 700 MLN STG") cnt[1]++;
  if (b == "BANK OF SPAIN SUSPENDS ASSISTANCE") cnt[1]++;
  if (b == "U.K. MONEY MARKET GIVEN 265 MLN STG ASSISTANCE") cnt[1]++;
  if (b == "BANK OF FRANCE AGAIN BUYING DOLLARS, SOURCES SAY") cnt[1]++;
  if (b == "BUNDESBANK BOUGHT DOLLARS AGAINST YEN, DEALERS SAY") cnt[1]++;
  if (b == "U.K. MONEY MARKET GIVEN FURTHER 663 MLN STG HELP") cnt[1]++;
  if (b == "AUSTRIA DOES NOT INTERVENE TO SUPPORT DOLLAR") cnt[1]++;
  if (b == "TAIWAN TO STUDY SUSPENDING FOREX CONTROLS") cnt[1]++;
  if (b == "OFFICIAL WANTS ARAB FUND TO HELP LEBANESE POUND") cnt[1]++;
  if (b == "CHINA POSTPONES PLAN TO SCRAP PARALLEL CURRENCY") cnt[1]++;
  if (b == "ARAB BANKER SAYS TOO SOON FOR SINGLE CURRENCY") cnt[1]++;
  if (b == "ARAB FOREX ASSOCIATION ELECTS NEW CHAIRMAN") cnt[1]++;
  if (b == "JAPAN CAREFULLY CONSIDERING MONEY POLICY -- SUMITA") cnt[1]++;
  if (b == "BAHRAIN INTRODUCES NEW MONEY MARKET REGIME") cnt[1]++;
  if (b == "BANK OF ENGLAND FORECASTS SURPLUS IN MONEY MARKET") cnt[1]++;
  if (b == "PHILADELPHIA EXCHANGE TO EXTEND HOURS FOR ASIA") cnt[1]++;
  if (b == "JAPAN CONDUCTS CURRENCY SURVEY OF BIG INVESTORS") cnt[1]++;
  if (b == "BANK OF ENGLAND DOES NOT OPERATE IN MONEY MARKET") cnt[1]++;
  if (b == "ASIAN DOLLAR MARKET ASSETS FALL IN JANUARY") cnt[1]++;
  if (b == "PHILADELPHIA EXCHANGE TO EXTEND HOURS FOR ASIA") cnt[1]++;
  if (b == "JAPAN CAREFULLY CONSIDERING MONEY POLICY - SUMITA") cnt[1]++;
  if (b == "U.K. MONEY MARKET GIVEN 129 MLN STG ASSISTANCE") cnt[1]++;
  if (b == "JAPAN CONDUCTS CURRENCY SURVEY OF BIG INVESTORS") cnt[1]++;
  if (b == "JAPANESE SEEN LIGHTENING U.S. BOND HOLDINGS") cnt[1]++;
  if (b == "FED ADDS RESERVES VIA CUSTOMER REPURCHASES") cnt[1]++;
  if (b == "FORMER TREASURY OFFICIAL URGES CURRENCY REFORMS") cnt[1]++;
  if (b == "FED WILL BUY BILLS FOR CUSTOMER AFTER AUCTION") cnt[1]++;
  if (b == "TREASURY BALANCES AT FED FELL ON MARCH 27") cnt[1]++;
  if (b == "U.S. CREDIT MARKETS END UNDER EXTREME PRESSURE") cnt[1]++;
  if (b == "U.K. MONEY MARKET OFFERED EARLY ASSISTANCE") cnt[1]++;
  if (b == "UK MONEY MARKET GIVEN FURTHER 570 MLN STG HELP") cnt[1]++;
  if (b == "CALL MONEY PRESSURE FROM LARGE GERMAN BANKS") cnt[1]++;
  if (b == "U.K. MONEY MARKET SHORTAGE FORECAST REVISED UP") cnt[1]++;
  if (b == "U.K. MONEY MARKET GIVEN 215 MLN STG LATE HELP") cnt[1]++;
  if (b == "U.S. TREASURY'S BAKER SEES RATE STABILITY") cnt[1]++;
  if (b == "TREASURY'S BAKER SAYS COOPERATION WORKING") cnt[1]++;
  if (b == "TREASURY'S BAKER SAYS U.S. BACKS STABILITY") cnt[1]++;
  if (b == "BANGEMANN CALLS FOR CURRENCY CALM") cnt[1]++;
  if (b == "TREASURY'S BAKER PURSUING S. ASIAN REVALUATIONS") cnt[1]++;
  if (b == "TREASURY'S BAKER PURSUING S. ASIAN REVALUATIONS") cnt[1]++;
  if (b == "CURRENCY FUTURES CLIMB LIKELY TO BE CHECKED") cnt[1]++;
  if (b == "U.S. FED EXPLORES COMMODITY BASKET INDEX") cnt[1]++;
  if (b == "U.K. MONEY MARKET OFFERED EARLY ASSISTANCE") cnt[1]++;
  if (b == "U.K. MONEY MARKET GIVEN 689 MLN STG EARLY HELP") cnt[1]++;
  if (b == "U.K. MONEY MARKET SHORTAGE FORECAST REVISED UP") cnt[1]++;
  if (b == "U.K. MONEY MARKET DEFICIT REVISED DOWNWARDS") cnt[1]++;
  if (b == "FED BUYS ONE BILLION DLRS OF BILLS FOR CUSTOMER") cnt[1]++;
  if (b == "FED BUYS ONE BILLION DLRS OF BILLS FOR CUSTOMER") cnt[1]++;
  if (b == "N.Z. TRADING BANK DEPOSIT GROWTH RISES SLIGHTLY") cnt[2]++;
  if (b == "NEW YORK BUSINESS LOANS FALL 222 MLN DLRS") cnt[2]++;
  if (b == "U.S. M-1 MONEY SUPPLY RISES 1.2 BILLION DLR") cnt[2]++;
  if (b == "CANADIAN MONEY SUPPLY FALLS IN WEEK") cnt[2]++;
  if (b == "DUTCH MONEY SUPPLY HARDLY CHANGED IN DECEMBER") cnt[2]++;
  if (b == "U.K. CONFIRMS FEBRUARY STERLING M3 RISE") cnt[2]++;
  if (b == "SINGAPORE M-1 MONEY SUPPLY 2.7 PCT UP IN JANUARY") cnt[2]++;
  if (b == "SINGAPORE BANK CREDIT RISES IN JANUARY") cnt[2]++;
  if (b == "H.K. M3 MONEY SUPPLY RISES 1.4 PCT IN FEBRUARY") cnt[2]++;
  if (b == "U.S. BANK DISCOUNT BORROWINGS 310 MLN DLRS") cnt[2]++;
  if (b == "U.S. M-1 MONEY SUPPLY ROSE 2.1 BILLION DLRS") cnt[2]++;
  if (b == "AUSTRALIAN BROAD MONEY GROWTH 10.3 PCT IN FEBRUARY") cnt[2]++;
  if (b == "TAIWAN ISSUES MORE CERTIFICATES OF DEPOSIT") cnt[2]++;
  if (b == "SOUTH KOREAN MONEY SUPPLY FALLS IN MARCH") cnt[2]++;
  if (b == "BELGIAN MONEY SUPPLY RISES IN FOURTH QUARTER 1986") cnt[2]++;
  if (b == "CANADIAN MONEY SUPPLY FALLS IN WEEK") cnt[2]++;
  if (b == "TREASURY BALANCES AT FED ROSE ON FEB 27") cnt[2]++;
  if (b == "FEBRUARY FOMC VOTES UNCHANGED MONETARY POLICY") cnt[2]++;
  if (b == "U.S. BUSINESS LOANS FELL 822 MLN DLRS") cnt[2]++;
  if (b == "GERMAN CAPITAL ACCOUNT IN DEFICIT IN FEBRUARY") cnt[2]++;
  if (b == "TREASURY BALANCES AT FED ROSE ON APRIL 6") cnt[2]++;
  if (b == "TAIWAN ISSUES MORE CDS TO CURB MONEY SUPPLY GROWTH") cnt[2]++;
  if (b == "SOUTH KOREAN MONEY SUPPLY RISES IN FEBRUARY") cnt[2]++;
  if (b == "SPAIN RAISES BANKS' RESERVE REQUIREMENT") cnt[2]++;
  if (b == "N.Z. MONEY SUPPLY RISES 3.6 PCT IN DECEMBER") cnt[2]++;
  if (b == "FED DATA SUGGEST STABLE U.S. MONETARY POLICY") cnt[2]++;
  if (b == "N.Z. CENTRAL BANK SEES SLOWER MONEY, CREDIT GROWTH") cnt[2]++;
  if (b == "U.S. M-1 MONEY SUPPLY RISES 1.9 BILLION DLRS") cnt[2]++;
  if (b == "U.S. MONEY GROWTH SLOWS SHARPLY, ECONOMISTS SAY") cnt[2]++;
  if (b == "CANADIAN MONEY SUPPLY RISES IN WEEK") cnt[2]++;
  if (b == "TREASURY BALANCES AT FED FELL ON MARCH 5") cnt[2]++;
  if (b == "U.S. BUSINESS LOANS FALL 618 MLN DLRS") cnt[2]++;
  if (b == "SINGAPORE M-1 MONEY SUPPLY UP 3.7 PCT IN DECEMBER") cnt[2]++;
  if (b == "FRENCH JANUARY M-3 MONEY SUPPLY RISES ONE PCT") cnt[2]++;
  if (b == "U.K. CONFIRMS JANUARY STERLING M3 RISE") cnt[2]++;
  if (b == "TREASURY BALANCES AT FED ROSE ON MARCH 6") cnt[2]++;
  if (b == "SPAIN'S MONEY SUPPLY GROWTH DOUBLES IN FEBRUARY") cnt[2]++;
  if (b == "TREASURY BALANCES AT FED FELL ON MARCH 10") cnt[2]++;
  if (b == "NEW YORK BUSINESS LOANS FALL 718 MLN DLRS") cnt[2]++;
  if (b == "U.S. M-1 MONEY SUPPLY FALLS 600 MLN DLRS") cnt[2]++;
  if (b == "JAPAN PERSONAL SAVINGS SOAR IN 1986") cnt[2]++;
  if (b == "CANADIAN MONEY SUPPLY RISES IN WEEK") cnt[2]++;
  if (b == "U.S. BUSINESS LOANS RISE 377 MLN DLRS") cnt[2]++;
  if (b == "BANGLADESH MONEY SUPPLY RISES IN DECEMBER") cnt[2]++;
  if (b == "GERMAN FEBRUARY CENTRAL BANK MONEY GROWTH STEADY") cnt[2]++;
  if (b == "THAI M-1 MONEY SUPPLY RISES IN JANUARY") cnt[2]++;
  if (b == "JAPAN FEBRUARY MONEY SUPPLY RISES 8.8 PCT") cnt[2]++;
  if (b == "ASSETS OF U.S. MONEY FUNDS ROSE IN WEEK") cnt[2]++;
  if (b == "ITALY M-2 UP 2.8 PCT IN 3 MONTHS TO END JANUARY") cnt[2]++;
  if (b == "PHILIPPINES' LIQUIDITY RISES, LOAN DEMAND FALLS") cnt[2]++;
  if (b == "WHITE HOUSE UNIT DECIDES ON SEMICONDUCTORS") cnt[3]++;
  if (b == "CHINA CALLS FOR BETTER TRADE DEAL WITH U.S.") cnt[3]++;
  if (b == "GATT WARNS U.S. ON FEDERAL BUDGET, PROTECTIONISM") cnt[3]++;
  if (b == "WHITE HOUSE PANEL SAID URGING JAPAN RETALIATION") cnt[3]++;
  if (b == "NAKASONE TO VISIT WASHINGTON IN LATE APRIL") cnt[3]++;
  if (b == "WORLD BANK CHIEF URGES MORE JAPANESE INVESTMENT") cnt[3]++;
  if (b == "NAKASONE TO VISIT WASHINGTON IN LATE APRIL") cnt[3]++;
  if (b == "NAKASONE HARD-PRESSED TO SOOTHE U.S ANGER ON TRADE") cnt[3]++;
  if (b == "INDIA STEPS UP COUNTERTRADE DEALS TO CUT TRADE GAP") cnt[3]++;
  if (b == "UK MAY REVOKE JAPANESE FINANCIAL LICENSES") cnt[3]++;
  if (b == "REAGAN READY TO IMPOSE TRADE CURBS AGAINST JAPAN") cnt[3]++;
  if (b == "JAPAN'S CHIP MAKERS ANGERED BY U.S. SANCTION PLANS") cnt[3]++;
  if (b == "NAKASONE SOUNDS CONCILIATORY NOTE IN CHIP DISPUTE") cnt[3]++;
  if (b == "ISLAMIC BANKS ESTABLISH 50 MLN DLR TRADE PORTFOLIO") cnt[3]++;
  if (b == "TOKYO BIDS TO STOP CHIP ROW TURNING INTO TRADE WAR") cnt[3]++;
  if (b == "BALDRIGE PREDICTS END OF U.S.-JAPAN TRADE DISPUTE") cnt[3]++;
  if (b == "JAPAN HAS LITTLE NEW TO OFFER IN MICROCHIP DISPUTE") cnt[3]++;
  if (b == "NAKASONE SOUNDS CONCILIATORY NOTE IN CHIP DISPUTE") cnt[3]++;
  if (b == "TOKYO BIDS TO STOP CHIP ROW BECOMING TRADE WAR") cnt[3]++;
  if (b == "BALDRIGE PREDICTS END OF U.S.-JAPAN TRADE DISPUTE") cnt[3]++;
  if (b == "YUGOSLAV TRADE FALLS SHARPLY  STATISTICS SHOW") cnt[3]++;
  if (b == "ECONOMIC SPOTLIGHT - U.S. CONGRESS RAPS JAPAN") cnt[3]++;
  if (b == "U.S. TRADE OFFICIAL SAYS JAPAN ACTION FOOLISH") cnt[3]++;
  if (b == "EUROPEAN COMMUNITY TO SET UP OFFICE IN PEKING") cnt[3]++;
  if (b == "TRADE FRICTION THREATENS TO TOPPLE NAKASONE") cnt[3]++;
  if (b == " EUROPE ON SIDELINES IN U.S-JAPAN MICROCHIP ROW") cnt[3]++;
  if (b == "THATCHER SAYS TRADE TARGETS SET WITH MOSCOW") cnt[3]++;
  if (b == "JAPAN TO CUT MICROCHIP OUTPUT, BOOST IMPORTS") cnt[3]++;
  if (b == "JAPAN WILL ASK COMPANIES TO BOOST IMPORTS") cnt[3]++;
  if (b == "U.S./JAPAN TRADE WAR NOT IN UK'S INTEREST - LAWSON") cnt[3]++;
  if (b == "EC APPROVES MEDITERRANEAN FINANCIAL PACKAGES") cnt[3]++;
  if (b == "SOVIET UNION SEEN WATCHING CHINA GATT APPLICATION") cnt[3]++;
  if (b == "U.S. SENATE LEADERS SEE NO TRADE WAR BREWING") cnt[3]++;
  if (b == "U.S. STOCK MARKET OVERREACTS TO TARIFFS - YEUTTER") cnt[3]++;
  if (b == "ENVOY ADVISES NAKASONE TO PREPARE FOR U.S. VISIT") cnt[3]++;
  if (b == "TREASURY'S BAKER SEES SMALLER TRADE DEFICIT") cnt[3]++;
  if (b == "TREASURY'S BAKER NOT CONCERNED BY BOND DECLINES") cnt[3]++;
  if (b == "U.S.-JAPAN NOT IN TRADE WAR, YEUTTER SAYS") cnt[3]++;
  if (b == "CHIRAC, REAGAN DISCUSS ARMS CONTROL, TRADE") cnt[3]++;
  if (b == "TRADE WAR FEARS MAY PROMPT STOCK MARKETS' DOWNTURN") cnt[3]++;
  if (b == "WHITE HOUSE DISCOUNTS THREAT OF TRADE WAR") cnt[3]++;
  if (b == "BALDRIGE SAYS U.S. TO IMPOSE JAPANESE SANCTIONS") cnt[3]++;
  if (b == "SENIOR U.S. OFFICIAL TO VISIT JAPAN AS TRADE ROW GROWS") cnt[3]++;
  if (b == "BROADER U.S. EEP SOUGHT BY REPUBLICAN LAWMAKERS") cnt[3]++;
  if (b == "U.S. OFFICIAL TO VISIT JAPAN AS TRADE ROW GROWS") cnt[3]++;
  if (b == "U.S. OFFICIAL SEES EVIDENCE OF EXPORT GROWTH") cnt[3]++;
  if (b == "TAIWAN'S SECOND QUARTER IMPORTS SEEN RISING") cnt[3]++;
  if (b == "BELGIAN SAYS EC WOULD REACT TO TEXTILE BILL") cnt[3]++;
  if (b == "ROSTENKOWSKI OPPOSES PROTECTIONIST TRADE BILL") cnt[3]++;
  if (b == "U.K. EXPORTS BODY GETS NEW EXECUTIVE DIRECTOR") cnt[3]++;
  for (j = 1, i = 2; i < 4; i++)
    if (cnt[i] > cnt[j]) j = i;
  printf("%d\n", j);
  return 0;
}
