<image>

You can preview the image in better quality by the link: [http://assets.codeforces.com/files/656/without-text.png](//assets.codeforces.com/files/656/without-text.png)

Input

The only line of the input is a string (between 1 and 50 characters long, inclusive). Each character will be an alphanumeric character or a full stop ".".

Output

Output the required answer.

Examples

Input

Codeforces


Output

-87


Input

APRIL.1st


Output

17
def split(text,ms,length):
    return text[:ms],text[ms],text[ms+1:]


def comparetext(a,b):
    return a==b,a<b,a>b

def AND(a,b):
    return a and b

def booltoint(a):
    return int(a)

def alphaindex(a):
    return ord(a.lower())-ord('a')+1

def times(i,j):
    return i*j

def minus(i,j):
    return i-j

def plus(i,j):
    return i+j


s = raw_input()
res = 0
for i in range(len(s)):
    before,middle,after = split(s,i,1)

    f1 = comparetext('@',middle)
    f2 = comparetext('[',middle)
    f3 = comparetext('`',middle)
    f4 = comparetext('{',middle)

    a1 = int(AND(f1[1],f2[2]))
    a2 = int(AND(f3[1],f4[2]))

    ind = alphaindex(middle)

    t1 = times(a1,ind)
    t2 = times(ind,a2)

    mn = minus(t1,t2)
    res = plus(mn,res)

print res

    
    
