What Is Your Name Score?
InterviewTime limit1sMemory limit128 MB
Given an uppercase name, sum the alphabetical position of each letter and print the total.
- Level
Easy1 of 10
- Topics
- String, Implementation
- Solved
- No attempts yet
Problem
The name score is the sum of the scores of every uppercase letter in a name. The score table follows alphabetical order, that is, .
For a name , the score is . For a name , the score is .
Given a name, write a program that computes its name score.
Input
The first line contains the length of the name. is a positive integer not exceeding 100.
The second line contains the name of length . It consists of uppercase letters only, with no spaces.
Output
Print the name score of the given name on the first line.