import java.util.Scanner;

/**
 * Scores a token according to the Scrabble rules.
 */
public class ScrabbleScorer
{
  public static void main (String[] args)
  {
    // 1 point: a, e, i, l, n, o, r, s, t, u
    String point1 = "aeilnrstu";
    // 2 points: d, g
    String point2 = "dg";
    // 3 points: b, c, m, p
    String point3 = "bcmp";
    // 4 points: f, h, v, w, y
    String point4 = "fhvwy;";
    // 5 points: k
    String point5 = "k";
    // 8 points: j, x
    String point8 = "jx";
    // 10 points: q, z
    String point10 = "qz";

    // Get in a word
    Scanner in = new Scanner(System.in);
    System.out.println("Input a word to be scored:");
    String target = in.next();

    // Loop through the string, scoring each character
    int score = 0;
    int pos = 0;

    while (pos < target.length())
    {
      char currLetter = target.charAt(pos);
      if (point1.indexOf(currLetter) >= 0)
      {
        score+=1;
      } else if (point2.indexOf(currLetter) >= 0)
      {
        score +=2;
      } else if (point3.indexOf(currLetter) >= 0)
      {
        score +=3;
      } else if (point4.indexOf(currLetter) >= 0)
      {
        score += 4;
      } else if (point5.indexOf(currLetter) >= 0)
      {
        score += 5;
      } else if (point8.indexOf(currLetter) >= 0)
      {   score += 8;
      } else {
          score += 10;
      } // end if

      pos++;
    } // end while

    System.out.println("The score of \"" + target
                + "\" is " + score);

  } 
}