<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
#include <bits/stdc++.h>
using namespace std;
long long const modul = 1000000000000000;
long long mod_sum(long long x, long long y) { return (x + y) % modul; }
long long mod_sub(long long x, long long y) {
  if (x > y) {
    return (x - y) % modul;
  } else {
    return (modul + x - y) % modul;
  }
}
long long mod_mpl(long long x, long long y) { return (x * y) % modul; }
void set_precise(int n) {
  cout << fixed;
  cout << setprecision(n);
}
bool compare_1(char x) { return ('@' < x); }
bool compare_2(char x) { return ('[' > x); }
bool compare_3(char x) { return ('`' < x); }
bool compare_4(char x) { return ('{' > x); }
bool and_1(char x) { return (compare_1(x) && compare_2(x)); }
bool and_2(char x) { return (compare_3(x) && compare_4(x)); }
int main() {
  string s;
  cin >> s;
  int res = 0;
  for (int i = 0; i < s.length(); ++i) {
    char cur = s[i];
    int left = 0;
    int right = 0;
    if (and_1(cur)) {
      left = 1;
    }
    if (and_2(cur)) {
      right = 1;
    }
    int mpl = 0;
    if (islower(cur)) {
      mpl = cur - 'a' + 1;
    }
    if (isupper(cur)) {
      mpl = cur - 'A' + 1;
    }
    left *= mpl;
    right *= mpl;
    int cur_res = left - right;
    res += cur_res;
  }
  cout << res;
  return 0;
}
