Quiz
Smriti's String
Submissions: 12   Accuracy:

33.33%

  Max. Score:

20

Smriti was sitting idle and thought of a problem. Given a string consisting of lowercase letters, task is to find the total sum of A+B+C+D+E, where A,B,C,D,E are the sA , mB , rC , iD , tE. To make problem simple Smriti gave the freedom to twist the provided string in any format. If the string "smrit" does not
exist print "-1".
Note: sA = sssss.....

Input:
First line consists of T test cases. Only line of every test cases consists of String consisting of lower case letters.

Output:
Single line output, print the required sum.

Constraints:
1<=T<=100
1<=|String length|<=10^4

Example:
Input:

2
smriti
abcsmab
Output:
6
-1


to report an issue on this page.