Program Template
Many teams participating in programming competitions use a "program template." This template is typed at the start of the competition and includes common elements for all solutions, such as opening and closing input and output files.
The three-time world champion team, the Dream Team, as recognized by AMC, is no exception. A significant part of their success is attributed to their meticulous preparation, which includes attention to even the smallest details. For instance, before their last final, during a trial round, they calculated the energy expenditure in joules required to type their template.
The keyboards used in the final had varying key stiffness, meaning different keys required different amounts of energy to press.
Through experiments conducted during the trial round, the Dream Team discovered the following energy requirements: Typing a lowercase Latin letter requires energy equal to the sum of the digits of its position in the alphabet (with letters numbered starting from one). Pressing the "Shift" key requires 10 joules of energy, so typing an uppercase letter requires 10 joules more than the corresponding lowercase letter. The "Space" key requires 4 joules. Typing the digit x requires 13-x joules. A period requires 5 joules, a semicolon requires 7 joules, and a comma requires 2 joules. The equal sign, plus, minus, single and double quotes each require 3 joules. Closing and opening parentheses require 1 joule each, while curly, square, and angle brackets (i.e., symbols < and >) require 8 joules each. For all these punctuation marks, there are dedicated keys on the keyboard used in the final, and no alternative method exists to type these symbols. Pressing the "Enter" key (newline) is so effortless that its energy expenditure is considered zero.
Your task is to write a program that calculates the energy expenditure for typing the template based on the text provided.
Input
The input file contains the program template for which the energy expenditure needs to be calculated. It includes only digits, spaces, lowercase and uppercase Latin letters, periods, commas, equal signs, pluses, semicolons, double quotes ("), single quotes ('), and closing and opening round, square, curly, and angle brackets.
The size of the template does not exceed 20000 bytes.
Output
In the output file, print the total energy expenditure required to type the template.