#include <bits/stdc++.h>
using namespace std;
int main() {
  string a;
  cin >> a;
  long long ans1 = 1, ans2 = 1;
  for (int i = 0; i < a.size(); i++) {
    if (a[i] >= 'A' && a[i] <= 'Z') ans1 += int(a[i] - '@');
    if (a[i] >= 'a' && a[i] <= 'z') ans2 += int(a[i] - 96);
  }
  cout << ans1 - ans2;
  return 0;
}
