

Time Limit: 2 sec / Memory Limit: 1024 MiB
配点 : 100 点
問題文
4 種類の牡蠣 1,2,3,4 があります。 このうちちょうど 1 種類の牡蠣については、食べるとお腹を壊してしまいます。 それ以外の牡蠣については、食べてもお腹を壊しません。
高橋君が牡蠣 1,2 を食べ、青木君が牡蠣 1,3 を食べました。
二人がこれによってお腹を壊したかどうかの情報が二つの文字列 S_1,S_2 によって与えられます。
具体的には、S_1= sick
であるとき高橋君がお腹を壊したことを、S_1= fine
であるとき高橋君がお腹を壊さなかったことを表します。
同様に、S_2= sick
であるとき青木君がお腹を壊したことを、S_2= fine
であるとき青木君がお腹を壊さなかったことを表します。
与えられた情報をもとに、どの種類の牡蠣を食べるとお腹を壊すか判定してください。
制約
- S_1, S_2 はそれぞれ
sick
またはfine
入力
入力は以下の形式で標準入力から与えられる。
S_1 S_2
出力
食べるとお腹を壊す牡蠣の種類の番号を出力せよ。
入力例 1
sick fine
出力例 1
2
牡蠣 1,2 を食べた高橋君はお腹を壊し、牡蠣 1,3 を食べた青木君はお腹を壊さなかったので、牡蠣 2 を食べるとお腹を壊すことがわかります。
入力例 2
fine fine
出力例 2
4
牡蠣 1,2 を食べた高橋君も牡蠣 1,3 を食べた青木君もお腹を壊さなかったので、残る牡蠣 4 を食べるとお腹を壊すことがわかります。
Score : 100 points
Problem Statement
There are four types of oysters, labeled 1, 2, 3, and 4. Exactly one of these types causes stomach trouble if eaten. The other types do not cause stomach trouble when eaten.
Takahashi ate oysters 1 and 2, and Aoki ate oysters 1 and 3. The information on whether each person got sick is given as two strings S_1 and S_2. Specifically, S_1 = sick
means Takahashi got sick, and S_1 = fine
means Takahashi did not get sick. Likewise, S_2 = sick
means Aoki got sick, and S_2 = fine
means Aoki did not get sick.
Based on the given information, find which type of oyster causes stomach trouble.
Constraints
- Each of S_1 and S_2 is
sick
orfine
.
Input
The input is given from Standard Input in the following format:
S_1 S_2
Output
Print the label of the oyster that causes stomach trouble if eaten.
Sample Input 1
sick fine
Sample Output 1
2
Takahashi (who ate oysters 1 and 2) got sick, and Aoki (who ate oysters 1 and 3) did not get sick, so it can be concluded that oyster 2 causes stomach trouble.
Sample Input 2
fine fine
Sample Output 2
4
Neither Takahashi (who ate oysters 1 and 2) nor Aoki (who ate oysters 1 and 3) got sick, so it can be concluded that oyster 4 causes stomach trouble.