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.....
First line consists of T test cases. Only line of every test cases consists of String consisting of lower case letters.
Single line output, print the required sum.