2396: Tournament Selection

Memory Limit:128 MB Time Limit:1.000 S
Creator:
Submit:5 Solved:3

Description

Each player in a tournament plays six games. There are no ties. The tournament director places the players in groups based on the results of games as follows: 
• if a player wins 5 or 6 games, they are placed in Group 1; 
• if a player wins 3 or 4 games, they are placed in Group 2; 
• if a player wins 1 or 2 games, they are placed in Group 3; 
• if a player does not win any games, they are eliminated from the tournament. 
Write a program to determine which group a player is placed in. 
在一场锦标赛中,每位选手进行六场比赛。没有平局。比赛主任根据比赛结果将选手分组,具体规则如下: 
• 如果一名选手赢了 5 场或 6 场比赛,他们将被分到第 1 组; 
• 如果一名选手赢了 3 场或 4 场比赛,他们将被分到第 2 组; 
• 如果一名选手赢了 1 场或 2 场比赛,他们将被分到第 3 组; 
• 如果一名选手没有赢得任何比赛,他们将被淘汰出锦标赛。 
编写一个程序来确定选手被分配到哪个小组。

Input

The input consists of six lines, each with one of two possible letters: W (to indicate a win) or L (to indicate a loss).  
输入由六行组成,每行包含两个可能的字母之一:W(表示获胜)或 L(表示失败)。

Output

The output will be either 1, 2, 3 (to indicate which Group the player should be placed in) or -1 (to indicate the player has been eliminated).
输出将是 1、2、3(表示选手应该被分配到哪个小组)或 -1(表示选手已被淘汰)。

Sample Input

W
L
W
W
L
W

Sample Output

2

Source/Category