#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  long long ans = 0;
  cin >> s;
  for (long long i = 0; i < s.size(); i++) {
    char c = s[i];
    long mul = c >= 'a' ? c - 'a' : c - 'A';
    ans += (mul + 1) * (('@' < c && '[' > c) - ('`' < c && '{' > c));
  }
  cout << ans;
}
