#K61892. Calculate Total Score

    ID: 31410 Type: Default 1000ms 256MiB

Calculate Total Score

Calculate Total Score

You are given a list of player actions. Each action corresponds to a number of points given by the following rules:

  • \(\texttt{attack} = 5\)
  • \(\texttt{defend} = 3\)
  • \(\texttt{heal} = 2\)
  • \(\texttt{run} = 1\)

If an action is not one of the above, it should be ignored. Your task is to compute the total score by summing up the points of all valid actions.

The input will be provided as a single line of space-separated action strings (read from stdin) and the output should be a single integer (written to stdout).

inputFormat

The input consists of a single line containing space-separated strings, each representing a player's action. Actions are case-sensitive and only the following ones are valid:

  • attack: 5 points
  • defend: 3 points
  • heal: 2 points
  • run: 1 point

Any other action should be ignored. You may assume that the input is well-formed.

outputFormat

Output a single integer which is the total score calculated from the given sequence of actions.

## sample
attack
5