<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
import java.io.*;
import java.util.*;

/**
 * Created by zxc on 05.10.2014.
 */
public class C {

    void solve() throws IOException {
        String str = nextToken();
        char[] a = str.toCharArray();
        int res = 0;
        boolean a1 = false;
        boolean a2 = false;
        boolean a3 = false;
        boolean a4 = false;

        for(int i=0;i<a.length;i++){
            a1='@'<a[i];
            a2='['>a[i];
            a3='`'<a[i];
            a4='{'>a[i];
            int b1 = (a1&&a2) ? 1 : 0;
            int b2 = (a3&&a4) ? 1 : 0;
            int k=0;
            if(a[i] <= 'Z' && a[i] >= 'A'){
                k = a[i]-'A' + 1;
            }
            if(a[i] <= 'z' && a[i] >= 'a'){
                k = a[i]-'a' + 1;
            }
            int c1 = k*b1;
            int c2 = k*b2;
            int d = c1-c2;
            res += d;
        }
        out.print(res);

    }


    void run() throws IOException {
        //reader = new BufferedReader(new FileReader("B-large.in"));
        reader = new BufferedReader(new InputStreamReader(System.in));
        tokenizer = null;
        //out = new PrintWriter(new FileWriter("B-large.out"));
        out = new PrintWriter(new OutputStreamWriter(System.out));
        solve();
        reader.close();
        out.flush();
    }

    public static void main(String[] args) throws IOException {
        new C().run();
    }

    BufferedReader reader;
    StringTokenizer tokenizer;
    PrintWriter out;

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    String nextToken() throws IOException {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
    }

}
