Tournament Selection

Count wins among six game results and print the group number 1, 2, or 3, or -1 if there are no wins.

Easy1ImplementationStringNo attempts yetTime limit2sMemory limit512 MB

Problem

Each player in a tournament plays six games. There are no ties. The tournament director assigns each player to a group from the game results:

  • a player who wins 5 or 6 games goes to Group 1;
  • a player who wins 3 or 4 games goes to Group 2;
  • a player who wins 1 or 2 games goes to Group 3;
  • a player who wins no games is eliminated from the tournament.

Write a program that determines which group a player is assigned to.

Input

The input consists of six lines. Each line holds one letter: W for a win or L for a loss.

Output

Print the group number the player is assigned to, one of 1, 2, or 3. Print -1 if the player is eliminated.