/// {{{ by WangYenJen
#include <bits/stdc++.h>

using namespace std;

// types
typedef long long ll;
typedef pair<int,int> pii;

// macro
#define F first
#define S second
#define SZ(x) ((int)x.size())
#define MP make_pair
#define PB push_back
#define ALL(x) (x).begin() , (x).end()
#define REP(i , n) for(int i = 0; i < int(n); i++)
#define REP1(i , a , b) for(int i = (a); i <= int(b); i++)
#define PER(i , n) for(int i = (n) - 1; i >= 0; i--)
#define PER1(i , a , b) for(int i = (a); i >= int(b); i--)
#define LC o<<1 , l , m
#define RC o<<1|1 , m + 1 , r
#define MS(x , v) memset(x , (v) , sizeof(x))

// input
inline bool SR(int &x) {
	return scanf("%d",&x) == 1;
}

inline bool SR(ll &x) {
	return scanf("%lld",&x) == 1;
}

inline bool SR(double &x) {
	return scanf("%lf",&x);
}

inline bool SR(char *s) {
	return scanf("%s",s);
}

inline bool RI() {
	return 1;
}

template<typename I , typename... T>
bool RI(I &x , T&... tail) {
	return SR(x) && RI(tail...);
}

// output
inline void SP(const int x) {
	printf("%d",x);
}

inline void SP(const ll x) {
	printf("%lld",x);
}

inline void SP(const double x) {
	printf("%.10f",x);
}

inline void SP(const char *s) {
	printf("%s",s);
}

inline void PL() {
	puts("");
}

template<typename I , typename... T>
void PL(const I x , const T... tail) {
	SP(x);
	if(sizeof...(tail)) putchar(' ');
	PL(tail...);
}

// debug function
#define WangYenJen

#ifdef WangYenJen
template<typename I>
inline void _DOING(const char *s , I&& x) {
	cerr << s << " = " << x << '\n';
}

template<typename I , typename... T>
void _DOING(const char *s , I&& x , T&&... tail) {
	int c = 0;
	while(*s != ',' || c != 0) {
		if(*s == '(' || *s == '[' || *s == '{') c++;
		if(*s == ')' || *s == ']' || *s == '}') c--;
		cerr << *s++;
	}
	cerr << " = " << x << " , ";
	_DOING(s + 1 , tail...);
}

#define DEBUG(...) \
	do { \
		fprintf(stderr , "%s : %d - " , __PRETTY_FUNCTION__ , __LINE__); \
		_DOING(#__VA_ARGS__ , __VA_ARGS__); \
	} while(0);

#else
#define DEBUG(...)
#endif

// constant number
const int INF = 0x3f3f3f3f;
const ll INF64 = 0x3f3f3f3f3f3f3f3fll;

// random function
inline int RAND() {
	static int x = 880301;
	return x = (x * 0xdefacedll + 1ll) % 0x7fffffffll;
}
/// }}}

const int MAX_N = 50 + 7;

char s[MAX_N];

int main() {
	RI(s);
	int n = strlen(s);
	int ans = 0;
	REP(i , n) {
        	int c = s[i];
		int x = ('@' < c) && ('[' > c);
		int y = ('`' < c) && ('{' > c);
		int z = tolower(c) - 'a' + 1;
		int a = x * z;
		int b = y * z;
		ans += a - b;
	}
	PL(ans);
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
	string s;
	int ans=0;
	cin>>s;
	for(int i=0;i<s.length();i++){
		if(s[i]<='z'&&s[i]>='a')ans-=s[i]-96;
		if(s[i]<='Z'&&s[i]>='A')ans+=s[i]-64;
	}
	cout<<ans;
}

#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;

#define REP(i,n) for(int i=0; i<n; i++)
#define FOR(i,a,b) for(int i=a; i<=b; i++)
#define FORR(i,a,b) for (int i=a; i>=b; i--)
#define pi M_PI

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef pair<int,int> PII;

int main(void){
	string str;
	cin >> str;
	int ans = 0;
	REP(i,str.length()){
		char c = str[i];
		int a = ('@'<c) && ('['>c);
		int b = ('_'<c) && ('{'>c);
		int x = (c<='Z' ? c-'A' : c-'a');
		x++;
		a *= x;
		b *= x;
		ans += a-b;
	}

	cout << ans << endl;

    return 0;
}

#include <iostream>
#include <string>
using namespace std;

int main(void) {
	string s;
	char c;
	cin >> s;
	int a = 0;
	for (int i = 0, c = s[0]; i < s.size(); c = s[++i]) {
		bool x = ('@' < c) && (c < '[');
		bool y = ('`' < c) && (c < '{');
		int tmp = (c >= 'a' && c <= 'z') ? c - 'a' + 1 : ((c >= 'A' && c <= 'Z') ? c - 'A' + 1 : 0);
		a += (x ? tmp : 0) - (y ? tmp : 0);
	}
	cout << a << endl;
	return 0;
}

//
//  main.cpp
//  bsuir2016
//
//  Created by Artjom Bastun on 3/28/16.
//  Copyright © 2016 Artjom Bastun. All rights reserved.
//

#include <iostream>
#include <string.h>
#include <ctype.h>

using namespace std;

//void a() {
//  int a;
//  cin >> a;
//  long ans = 1;
//  for (int i = 0; i < a; ++i) {
//    ans *= 2;
//  }
//  cout << ans << endl;
//}

void c() {
  char str[51];
  cin >> str;
  int res = 0;
  for (int i = 0; i < strlen(str); ++i) {
    char c = str[i];
    int a1 = '@' < c;
    int b1 = '[' > c;
    int a2 = '`' < c;
    int b2 = '{' > c;
    int i1 = a1 && b1;
    int j1 = tolower(c) - 'a' + 1;
    int i2 = j1;
    int j2 = a2 && b2;
    res += i1 * j1 - i2 * j2;
  }

  cout << res << endl;
}

int main(int argc, const char * argv[]) {
  c();
  return 0;
}

#include <cstdio>
#include <cstring>
#include <cstdlib>

using namespace std;

int main ()
{
	char s[100];
	scanf("%s",s);
	int N = strlen(s);
	int res = 0;
	int i;
	for (i = 0; i < N; i++)
	{
		if ((s[i] >= 'A') && (s[i] <= 'Z')) res += (int)(s[i] - 'A' + 1);
		else if ((s[i] >= 'a') && (s[i] <= 'z')) res -= (int)(s[i] - 'a' + 1);
	}
	printf("%d\n",res);
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
	string s;
	int i,ans=0;

	cin>>s;
	for(i=0;i<s.length();i++)
	{
		if(s[i]>='A' && s[i]<='Z')
		ans += s[i] - 'A' + 1;
		else if(s[i] >= 'a' && s[i]<='z')
		ans -= s[i] -'a' + 1;
	}
	cout<<ans;
	return 0;
}

#include<iostream>
using namespace std;
char c;
int tot;
int main()
{
	while(cin>>c)
		if('a'<=c&&c<='z')tot-=c-96;
		else if('A'<=c&&c<='Z')tot+=c-64;
	cout<<tot;
	return 0;
}

#include <iostream>
#include <string>
using namespace std;
int main ()
{
    string s;
    cin>>s;
    int ans(0);
	for (int i=0;i<s.size();i++)
		if (isupper(s[i]))
    	    ans+=s[i]-64;
		else if (islower(s[i]))
    		ans-=s[i]-96;
	cout<<ans;
}

#include <bits/stdc++.h>
using namespace std;
char s[100005];
int main() {
  long long ans = 0;
  gets(s);
  int n = strlen(s);
  for (int i = 0; i < n; i++) {
    if (s[i] >= 'A' && s[i] <= 'Z') {
      ans += s[i] - 'A' + 1;
    }
    if (s[i] >= 'a' && s[i] <= 'z') {
      ans -= s[i] - 'a' + 1;
    }
  }
  printf("%I64d\n", ans);
  return 0;
}

#include <iostream>

using namespace std;

int main() {
	char c;
	int r = 0;
	do {
		cin >> c;
		if (isalpha(c)) {
			if (c < 'a') {
				r += c - 'A' + 1;
			} else {
				r -= c - 'a' + 1;
			}
		}
	} while (cin.peek() != '\n');
	cout << r;

}

#include <bits/stdc++.h>

using namespace std;

typedef unsigned short ushort;
typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;

template <typename T>
ostream &operator<<(ostream &cout, vector<T> &a){
    for(ull i = 0; i < a.size(); ++i)
        cout << a[i] << " ";
    return cout;
}

template <typename T>
ostream &operator<<(ostream &cout, vector<vector<T> > &a){
    for(ull i = 0; i < a.size(); ++i)
        cout << a[i] << endl;
    return cout;
}

int main()
{
    string s;
    cin >> s;
    int res = 0;
    for(int i = 0; i < s.size(); ++i){
        res += ((s[i] > '@') & (s[i] < '[')) * (s[i] - 'A' + 1) - (s[i] - 'a' + 1) * ((s[i] > '`') & (s[i] < '{'));
    }
    cout << res << endl;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main(){
	string s;
	cin>>s;
	int ans = 0;
    for (int i = 0; i < s.length(); i++)
    {
        if (s[i] >= 'a' && s[i] <= 'z')
            ans -= (s[i] - 'a') + 1;

        else if (s[i] >= 'A' && s[i] <= 'Z')
            ans += (s[i] - 'A') + 1;
    }

    cout << ans<<endl;

    return 0;
}

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;

static const ll MOD = 1000*1000*1000 + 7;
static const double PI = acos(-1.0);

int solve()
{

    string s;
    cin >> s;

    int res = 0;
    for(int i = 0; i < s.size(); ++i)
    {
        if (s[i] >='a' && s[i] <='z')res -= s[i] - 'a' + 1;
        else if (s[i] >='A' && s[i] <= 'Z') res += s[i] - 'A' + 1;
    }
    cout << res << endl;
    return 0;
}

int main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

    solve();

    return 0;
}

 #include <iostream>
using namespace std;
string x; int ans = 0;
main ()
{
    cin >> x;
    int s = x.length();

	for (int i = 0; i < s; i++)
		if (isupper(x[i]))
    		ans += x[i] - 64;
		else if (islower(x[i]))
    		ans -= x[i] - 96;

	cout << ans;
	return 0;
}

/* -*- coding: utf-8 -*-
 *
 * 0656C.cc: C. Without Text
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>

using namespace std;

/* constant */

const int MAX_N = 50;

/* typedef */

/* global variables */

char s[MAX_N + 4];

/* subroutines */

/* main */

int main() {
  //freopen("input.txt", "r", stdin);
  //freopen("output.txt", "w", stdout);

  scanf("%s", s);

  int sum = 0;

  for (int i = 0; s[i]; i++) {
    char c = s[i];
    if ('@' < c && '[' > c)
      sum += s[i] - 'A' + 1;
    else if ('`' < c && '{' > c)
      sum -= s[i] - 'a' + 1;
  }

  printf("%d\n", sum);
  return 0;
}

// Codeforces April Fools Day Contest 2016 C. Without Text (656/C)

#include <cstdio>

char input[51];

int main()
{
    scanf("%s", input);
    int res = 0;
    for (int i = 0; input[i]; ++i) {
        char ch = input[i];
        if (ch >= 'a' && ch <= 'z') res -= ch - 'a' + 1;
        if (ch >= 'A' && ch <= 'Z') res += ch - 'A' + 1;
    }
    printf("%d\n", res);

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define For(i,n) for(int i=1;i<=n;i++)
#define Fork(i,k,n) for(int i=k;i<=n;i++)
#define Rep(i,n) for(int i=0;i<n;i++)
#define ForD(i,n) for(int i=n;i;i--)
#define ForkD(i,k,n) for(int i=n;i>=k;i--)
#define RepD(i,n) for(int i=n;i>=0;i--)
#define Forp(x) for(int p=Pre[x];p;p=Next[p])
#define Forpiter(x) for(int &p=iter[x];p;p=Next[p])
#define Lson (o<<1)
#define Rson ((o<<1)+1)
#define MEM(a) memset(a,0,sizeof(a));
#define MEMI(a) memset(a,127,sizeof(a));
#define MEMi(a) memset(a,128,sizeof(a));
#define INF (2139062143)
#define F (100000007)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define vi vector<int>
#define pi pair<int,int>
#define SI(a) ((a).size())
typedef long long ll;
typedef unsigned long long ull;
ll mul(ll a,ll b){return (a*b)%F;}
ll add(ll a,ll b){return (a+b)%F;}
ll sub(ll a,ll b){return (a-b+llabs(a-b)/F*F+F)%F;}
void upd(ll &a,ll b){a=(a%F+b%F)%F;}
int read()
{
    int x=0,f=1; char ch=getchar();
    while(!isdigit(ch)) {if (ch=='-') f=-1; ch=getchar();}
    while(isdigit(ch)) { x=x*10+ch-'0'; ch=getchar();}
    return x*f;
}
int main()
{
//  freopen("C.in","r",stdin);
//  freopen(".out","w",stdout);

    int p1='@',p2='[',p3='`',p4='{';

    string s;
    cin>>s;
    int len=s.length();
    int res=0;
    Rep(i,len) {
        if (!isalpha(s[i])) continue ;
        int ind=tolower(s[i])-'a'+1;
        int k1=0,k2=0;
        if (p1<s[i]&&p2>s[i]) k1=ind;
        if (p3<s[i]&&p4>s[i]) k2=ind;
        res+=k1-k2;
    }
    cout<<res<<endl;

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
	string s;
	cin>>s;
	int sum=0;
	for (char i:s){
		if (i>='A'&&i<='Z')sum+=i-'A'+1;
		if (i>='a'&&i<='z')sum-=i-'a'+1;
	}
	cout<<sum<<endl;
}

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

#include <iostream>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <vector>
using namespace std;

#define _ (int)
#define all(a) a.begin(), a.end()
#define rep(i, a, b) for(int i=int(a); i<=int(b); ++i)
#define irep(i, a, b) for(int i=int(a); i>=int(b); --i)
#define repn(i, n) rep(i, 0, (n)-1)
#define irepn(i, n) irep(i, (n)-1, 0)
#define fillchar(a, x) memset(a, x, sizeof(a))
#define fi first
#define se second
#define pb push_back
#define mp make_pair
typedef long long LL;
typedef pair<LL,LL> PLL;
typedef pair<int,int> PII;
typedef pair<double,double> PDD;
typedef vector<LL> VL;
typedef vector<int> VI;
typedef vector<PII> VPI;
typedef vector<string> VS;
template<class T> bool setmax(T &_a, T _b) { if(_b>_a) { _a=_b; return true; } return false; }
template<class T> bool setmin(T &_a, T _b) { if(_b<_a) { _a=_b; return true; } return false; }
template<class T> T gcd(T _a, T _b) { return _b==0?_a:gcd(_b,_a%_b); }

int ind(char c) {
    if(c>='a' && c<='z') return int(c-'a'+1);
    return int(c-'A'+1);
}

int main() {
    string str; cin>>str;
    LL res=0;
    for(char c: str) {
        bool x1=('@'<c);
        bool x2=('['>c);
        bool x3=('`'<c);
        bool x4=('{'>c);
        int y1=int(x1 && x2);
        int y2=int(x3 && x4);
        int y3=ind(c);
        res+=y1*y3-y2*y3;
    }
    cout<<res<<endl;
    return 0;
}

#include <cstdio>
using namespace std;
int n,nr,x;
char c;
int main()
{
    scanf("%c",&c);
    while(c!='\n')
    {
        if(c<='z'&&c>='A')

        {
        if(c<'a')
         nr+=c-64;
        else
             nr-=(c-96);
        }
        scanf("%c",&c);

    }
    printf("%d",nr);

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int sum=0,len;
char s[100001];
int main()
{
	scanf("%s",s);
	len=strlen(s);
	for (int i=0;i<len;i++)
	{
		if (s[i]>='A'&&s[i]<='Z') sum+=s[i]-64;
		if (s[i]>='a'&&s[i]<='z') sum-=s[i]-96;
	}
	printf("%d",sum);
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
char s[100];
int main () {
	gets(s);
	int len=strlen(s), ans=0;
	for (int i=0; i<len; i++) {
		if (!isalpha(s[i])) continue;
		if (tolower(s[i])==s[i]) ans-=s[i]-'a'+1;
		else ans+=s[i]-'A'+1;
	}
	printf("%d\n", ans);
	return 0;
}

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
char str[100005];

int main(){
    while(~scanf("%s",str)){
        int len = strlen(str);
        ll ans = 0;
        for(int i = 0; i < len; ++i){
            if(str[i] >= 'A' && str[i] <= 'Z')
                ans += str[i] - 'A' + 1;
            if(str[i] >= 'a' && str[i] <= 'z')
                ans -= str[i] - 'a' + 1;
        }
        printf("%lld\n", ans);
    }
  return 0;
}

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <cstring>
#include <ctime>
#include <deque>
#include <forward_list>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream> // istringstream buffer(myString);
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef pair<int,int> pi;
typedef pair<ll,ll> pl;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pi> vpi;
struct dbg_ {template<typename T> dbg_ & operator ,(const T & x) { cerr << x << ' '; return *this;}} dbg_t;
struct cin_ {template<typename T> cin_ & operator ,(T & x) { cin >> x; return *this;}} cin_;
template <typename T1, typename T2>
static inline ostream & operator<<(ostream & os, std::pair<T1, T2> const& p) {
    os << "{" << p.first << ", " << p.second  << "}";return os;
}
#define sync ios_base::sync_with_stdio(0) //to synchronize the input of cin and scanf

#define inf 2000000007
#define eps 1e-9
#define popcnt __builtin_popcount
#define gcd __gcd

#define rep(i,n) for(int i=0, _##i=(n); i<_##i; ++i)
#define dwn(i,n) for(int i=(n); --i>=0; )
#define repr(i,l,r) for(int i=(l), _##i=(r); i<_##i; ++i)
#define dwnr(i,l,r) for(int i=(r), _##i=(l); --i>=_##i; )
#define repa(i,a) for(auto i : a)
#define rd(args...) { cin_,args; }

#define mp make_pair
#define pb push_back
#define x first
#define y second
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define in(b,a) ((a).find(b) != (a).end())
#define index(a,x) (lower_bound(all(a),x)-arr.begin())
#define fill(a,v) memset(a, v, sizeof(a))
#define clr(a) memset(a, 0, sizeof(a))
#define rda(a,n) rep(i,n){cin>>a[i];}
#define sz(a) ((int)(a.size()))

#define remax(a,b) (a)=max((a),(b))
#define remin(a,b) (a)=min((a),(b))
#define remax2(a,b,ai,bi) do{if((a)>(b)){a=b;ai=bi;}}while(0)
#define remin2(a,b,ai,bi) do{if((a)<(b)){a=b;ai=bi;}}while(0)
#define checkbit(n,b) ((n >> b) & 1)

#ifdef SLONICHOBOT
	#define tu cerr << "#line: " << __LINE__ << endl
	#define dbg(args ...) { cerr << "|" << __LINE__ << "| "; dbg_t,args;cerr << endl; }
	#define dbgg(X) cerr << #X ": " << X << endl
	#define debug(args...) do {cerr << #args << ": "; dbg_t,args; cerr << endl;} while(0)
	#define dbga(a,n) rep(i,n)cerr<<a[i]<<" ";cerr<<endl
	#define dbgc(a) repa(i,a)cerr<<a[i]<<',';cerr<<endl
#else
	#define tu
	#define dbg
	#define dbgg
	#define debug
	#define dbga
	#define dbgc
#endif

int main()
{
	string str; cin >> str;
	ll ret = 0;
	for(auto i: str) {
		ret += (bool)isupper(i)*((int)i-'A'+1) - (bool)islower(i)*((int)i-'a'+1);
	}
	cout << ret << endl;
	return 0;
}

#include<iostream>
#include<cmath>
#include<map>
#include<cstring>
using namespace std;
main()
{
    map<char,int>l;
    long long int t,b,s2=0,s1=0,i;
    char ch='a',a[100000];
    for(i=0;i<26;i++) l[ch+i]=i+1;
    cin>>a;
    for(i=0;i<strlen(a);i++)
    {
        if(isupper(a[i])) {
           a[i]=tolower(a[i]);
                s1+=l[a[i]];
        } else if(islower(a[i])) s2+=l[a[i]];

    } cout<<s1-s2<<endl;
    return 0;
}

//lxrtxdy!
#include <iostream>
using namespace std;

int main() {
    string s;
    getline(cin, s);
    int len = s.length();
    int sum = 0;
    for(int i = 0; i < len; i++) {
        bool b;
        if(s[i] >= 'A' && s[i] <= 'Z') {
            b = true;
        } else {
            b = false;
        }
        int sum1 = b * (s[i] - 'A' + 1);
        bool bb;
        if(s[i] >= 'a' && s[i] <= 'z') {
            bb = true;
        } else {
            bb =false;
        }
        int sum2 = bb * (s[i] - 'a' + 1);
        sum += sum1-sum2;
    }
    cout << sum << endl;
    return 0;
}
//orzlxr!

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

#include<bits/stdc++.h>
#define ll long long
#define rep(i,a,b) for(int i=a;i<=b;++i)
#define per(i,a,b) for(int i=a;i>=b;--i)
using namespace std;
int ans;
char a[10001];
int main(){
    scanf("%s",a+1);
    int l=strlen(a+1);
    for(int i=1;i<=l;i++){
        if((a[i]>='A')&&(a[i]<='Z')) ans+=a[i]+1-'A';
        if((a[i]>='a')&&(a[i]<='z')) ans-=a[i]+1-'a';
    }
    printf("%d",ans);
    return 0;
}

#include<bits/stdc++.h>
using namespace std;

int main()
{
    char s[100];
	scanf("%s",s);
	int l=strlen(s);
	int sum=0;
	for(int i=0;i<l;i++)
		if(s[i]>='A'&&s[i]<='Z')
			sum+=s[i]-'A'+1;
		else if(s[i]>='a'&&s[i]<='z')
			sum-=s[i]-'a'+1;
	printf("%d\n",sum);
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int ans;
string a;
int main()
{
	cin>>a;
	for(int i=0;i<a.length();i++){
		if(a[i]>='A'&&a[i]<='Z')
		ans+=a[i]-'A'+1;
		if(a[i]>='a'&&a[i]<='z')
		ans-=a[i]-'a'+1;
	}
	printf("%d",ans);
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int tot;
int len;
string a;
int main()
{
	getline(cin,a);
	len=a.length();
    for(int i=0;i<len;i++)
	{
        if((a[i]>='A')&&(a[i]<='Z'))
			tot+=a[i]+1-'A';
        if((a[i]>='a')&&(a[i]<='z'))
			tot-=a[i]+1-'a';
    }
    printf("%d\n",tot);
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
string s;
int main()
{
	int ans=0;
	cin>>s;
	for(int i=0;i<s.size();i++)
	{
		if((s[i]>='A')&&(s[i]<='Z')) ans+=(s[i]+1-'A');
		else if((s[i]>='a')&&(s[i]<='z')) ans-=(s[i]+1-'a');
	}
	cout<<ans<<"\n";
}

#include<iostream>
#include<iomanip>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<vector>
#include<cctype>
using namespace std;
string s;
static inline int withouttext(char x){return ((('A'<=x)&&(x<='Z'))?(x-64):((('a'<=x)&&(x<='z'))?(96-x):(0)));}
signed main(){getline(cin,s);long long ans(0);for(register int i(0);i^s.length();i++){ans+=(withouttext(s[i]));}return printf("%lld",ans),putchar(10),0;}

#include <map>
#include <set>
#include <cmath>
#include <queue>
#include <vector>
#include <cctype>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <algorithm>

using namespace std;
typedef long long LL;
typedef pair<int, int>pii;
set <pii >seet;
vector <int >vec;
map <int, int>mapp;
#define CL(a,b) memset(a,b,sizeof(a))

const int INF = 0x3f3f3f3f;
const double EPS = 1e-10;
const int MOD = 100000007;
const int maxn = 16 + 5;
string s;

int id(char c) {
    if (c >= 'A' && c <= 'Z') return c-'A'+1;
    if (c >= 'a' && c <= 'z') return c-'a'+1;
}

int main()
{
    LL res = 0;
    cin>>s;
    for (int i = 0; i < s.size(); i++) {
        char a1 = '@';
        char a2 = '[';
        char a3 = '`';
        char a4 = '{';
        int flag1 = (a1<s[i])&(a2>s[i]);
        int flag2 = (a3<s[i])&(a4>s[i]);
        res = res + (flag1*id(s[i]))-(flag2*id(s[i]));
    }
    cout<<res<<endl;
    return 0;
}

/*
int main() {
    long long C[502][502];
    for (int i=0;i<502;i++)
        C[i][0]=1;
    for (int i=1;i<502;i++)
        for (int j=1;j<=i;j++)
            C[i][j]=(C[i-1][j-1]+C[i-1][j])%1000000007;
    int t;
    scanf("%d", &t);
    while (t--) {
        scanf("%s", s);
        if (strlen(s) == 1) {
            printf("1\n");
            continue;
        }
        memset(a, 0, sizeof(a));
        for (int i = 0; i < strlen(s); i++) {
            a[s[i]-'a']++;
        }
        int mark = 0, sum = 0;
        for (int i = 0; i < 26; i++) {
            if (a[i] & 1) {
                mark++;
            }
            a[i] = a[i] / 2;
            sum += a[i];
        }
        if (mark > 1) {
            printf("0\n");
            continue;
        }
        LL ans = 1;
        for (int i = 0; i < 26; i++) {
            ans = (ans * C[sum][a[i]]) % 1000000007;
            sum -= a[i];
        }
        printf("%I64d\n", ans);
    }
    return 0;
}
*/

#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<set>
#include<map>
#include<cmath>
#include<queue>
#include<vector>
#include<fstream>
#define eps 1e-9
#define mod 1000000007
using namespace std;
string s;

int ans;
int ind(char c)
{
    if(c>='a')return c-'a'+1;
    else return c-'A'+1;
}
int main(){
    ans=0;
    cin>>s;
    for(int i=0;i<(int)s.length();++i)
    {
        ans+=(('@'<s[i])&&('['>s[i]))*(ind(s[i]))-(ind(s[i]))*(('`'<s[i])&&('{'>s[i]));
    }
    cout<<ans<<endl;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
char s[100005];
int main() {
  long long ans = 0;
  gets(s);
  int n = strlen(s);
  for (int i = 0; i < n; i++) {
    if (s[i] >= 'A' && s[i] <= 'Z') {
      ans += s[i] - 'A' + 1;
    }
    if (s[i] >= 'a' && s[i] <= 'z') {
      ans -= s[i] - 'a' + 1;
    }
  }
  printf("%I64d\n", ans);
  return 0;
}

#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <queue>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <stack>
#include <utility>
#include <vector>

#define INF 1000000000
#define FOR(i, a, b) for(int i=int(a); i<int(b); i++)
#define FORC(cont, it) for(typeof((cont).begin()) it = (cont).begin(); it != (cont).end(); it++)
#define pb push_back

using namespace std;

typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<vi> vvi;

string str;

int getInd(char a) {
	if (a >= 'a'&&a <= 'z') return a - 'a' + 1;
	if(a>='A'&&a<='Z') return a - 'A' + 1;
	return 1;
}

int main() {
	while (cin >> str) {
		int ans = 0;
		FOR(i, 0, str.length()) {
			char c = str[i];
			int i1 = '@'<c&&'['>c;
			int i2 = 96<c&&'{' > c;
			int alphIndex = getInd(str[i]);
			ans += (i1 - i2)*alphIndex;
		}
		cout << ans << endl;
	}
	return 0;
}

#include <bits/stdc++.h>
using namespace std;

long long iSum;
int yzc(char c)
{
    if (c>='A' && c<='Z')
        return c-'A'+1;
    else if (c>='a' && c<='z')
        return -(c-'a'+1);
    else
        return 0;
}
int main()
{
    string sInput;
    getline(cin,sInput);
    for(long long i=0; i<=sInput.length()-1;i++) iSum+=yzc(sInput[i]);
    cout<<iSum;
}

#include<iostream>
using namespace std;
char c;
int tot;
int main()
{
while(cin>>c)
if('a'<=c&&c<='z')tot-=c-96;
else if('A'<=c&&c<='Z')tot+=c-64;
cout<<tot;
return 0;
}

#include<bits/stdc++.h>
using namespace std;

int main() {
	string str;
	cin >> str;
	int res = 0;
	for(char c : str) {
		if('@' < c && c < '[') res += c - '@';
		else if('`' < c && c < '{') res -= c - '`';
	}
	cout << res << '\n';
	return 0;
}

#include <cstdio>

const int MAX_LEN = 50;

char s[MAX_LEN + 1];

int main(void) {
  scanf("%s", s);
  int answer = 0;
  int i = 0;
  while (s[i] != '\0') {
    char letter = s[i];
    int index = 0;
    if ('a' <= letter && letter <= 'z')
      index = letter - 'a' + 1;
    else if ('A' <= letter && letter <= 'Z')
      index = letter - 'A' + 1;
    answer += index * ((int)('@' < letter && '[' > letter) - (int)('`' < letter && '{' > letter));
    i++;
  }

  printf("%d\n", answer);
  return 0;
}

#include<map>
#include<list>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
int ans;
char a[10001];
int main(){
    scanf("%s",a+1);
    int l=strlen(a+1);
    for(int i=1;i<=l;i++){
        if((a[i]>='A')&&(a[i]<='Z')) ans+=a[i]+1-'A';//如果是大写加上，举个栗子：A就是+1（A-A+1),B就是+2（B-A+1）（这里也可以直接用a[i]-'@ 代替）
        if((a[i]>='a')&&(a[i]<='z')) ans-=a[i]+1-'a';//同上，改为减去即可
    }
    printf("%d",ans);
    return ~~(0-0);
}

#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#pragma comment(linker, "/STACK:16777216")

#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <iostream>
#include <map>
#include <stack>
#include <set>
#include <queue>
#include <numeric>
#include <algorithm>
#include <utility>
#include <bitset>
#include <cmath>
#include <sstream>
#include <functional>

#define all(a) (a).begin(),(a).end()
#define sz(a) (int)(a).size()

using namespace std;

typedef long long int64;
typedef vector<int> vi;
typedef vector< vi > vvi;
typedef vector<double> vd;
typedef vector< vd > vvd;
typedef vector< string > vs;
typedef pair< int, int > pii;
typedef vector< pii > vpii;

int main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "rt", stdin);
	freopen("output.txt", "wt", stdout);
#endif
	string s;
	cin >> s;
	int res = 0;
	for (int i = 0; i < sz(s); i++)
	{
		//bool t1 = ('@' < s[i]);
		//bool t2 = ('[' > s[i]);
		//int idx = 0;
		//if (isalpha(s[i]))
		//{
		//	idx = tolower(s[i]) - 'a';
		//}
		//else
		//	continue;
		//int idx1 = 0;
		//if (t1 && t2)
		//{
		//	idx1 = idx;
		//}

		//bool t3 = ('`' < s[i]);
		//bool t4 = ('{' > s[i]);
		//int idx2 = 0;
		//if (t3 && t4)
		//{
		//	idx2 = idx;
		//}

		//res += idx1 - idx2;

		if (s[i] >= 'A' && s[i] <= 'Z')
		{
			res += s[i] - 'A' + 1;
		}
		else if (s[i] >= 'a' && s[i] <= 'z')
		{
			res -= s[i] - 'a' + 1;
		}
	}
	cout << res;
	return 0;

}

#include <bits/stdc++.h>

using namespace std;

#ifdef ONLINE_JUDGE
#define OJ 1
#else
#define OJ 0
#endif

#define dd				double
#define ll 				long long
#define pb 				push_back
#define mp 				make_pair
#define X				first
#define Y				second
#define forn( i, n ) 	for( ll i = 0; i < (ll) (n); i ++ )
#define endl 			'\n'

#define TIMESTAMP fprintf(stderr, "Execution time: %.3lf s.\n", (double)clock()/CLOCKS_PER_SEC)

struct __s { __s() {
		srand( time( NULL ) );
		//freopen( "input.txt", "r", stdin ); freopen( "output.txt", "w", stdout );
		if( OJ ) { ios_base::Init i; cin.sync_with_stdio( 0 ); cin.tie( 0 ); }
	} ~__s() {
		if( !OJ ) TIMESTAMP;
		ll n; cin >> n;
	}
} __S;

int main( void ) {
	string s;
	cin >> s;
	ll ans = 0;
	forn( i, s.size() ) {
		bool d1 = '@' < s[i];
		bool d2 = '[' > s[i];
		bool d3 = '`' < s[i];
		bool d4 = '{' > s[i];
		ll ii = ( d1 && d2 );
		ll j = ( 'A' <= s[i] && s[i] <= 'Z' ? s[i] - 'A' : s[i] - 'a' ) + 1;
		ll k = ( d3 && d4 );
		ll a = ii * j;
		ll b = j * k;
		ll c = a - b;
		ans += c;
	}
	cout << ans << endl;
	return 0;
}

/*  */
#include <iostream>
#include <sstream>
#include <string>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
#include <deque>
#include <bitset>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstring>
#include <climits>
#include <cctype>
#include <cassert>
#include <functional>
#include <iterator>
#include <iomanip>
using namespace std;
//#pragma comment(linker,"/STACK:102400000,1024000")

#define sti				set<int>
#define stpii			set<pair<int, int> >
#define mpii			map<int,int>
#define vi				vector<int>
#define pii				pair<int,int>
#define vpii			vector<pair<int,int> >
#define rep(i, a, n) 	for (int i=a;i<n;++i)
#define per(i, a, n) 	for (int i=n-1;i>=a;--i)
#define clr				clear
#define pb 				push_back
#define mp 				make_pair
#define fir				first
#define sec				second
#define all(x) 			(x).begin(),(x).end()
#define SZ(x) 			((int)(x).size())
#define lson			l, mid, rt<<1
#define rson			mid+1, r, rt<<1|1
#define getBits(x)		__builtin_popcount(x)
#define getBitIdx(x)	__builtin_ffs(x)

typedef long long LL;

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	#ifndef ONLINE_JUDGE
		freopen("data.in", "r", stdin);
		freopen("data.out", "w", stdout);
	#endif

	string s;

	cin >> s;
	int len = s.length();
	int ans = 0;

	rep(i, 0, len) {
		if (isupper(s[i]))
			ans += s[i] - 'A' + 1;
		else if (islower(s[i]))
			ans -= s[i] - 'a' + 1;
	}

	cout << ans << endl;

	#ifndef ONLINE_JUDGE
		printf("time = %ldms.\n", clock());
	#endif

	return 0;
}

#include<bits/stdc++.h>
using namespace std;
const int L=55;
char ch[L]={};
int main()
{
	cin>>(ch+1);
	int l=strlen(ch+1),sum=0;
	for(int i=1;i<=l;++i)
	{
		if(ch[i]>'@' && ch[i]<'[')
			sum+=ch[i]-'@';
		if(ch[i]>'`' && ch[i]<'{')
			sum-=ch[i]-'`';
	}
	cout<<sum<<endl;
	return 0;
}

#include<bits/stdc++.h>

using namespace std;
typedef long long ll;
ll n , res;
ll r[100] , m[100];
char oo[100];
string s;
int main(){
    scanf("%s",&oo);
    s = oo;
    n = s.size();
    for(int i=0;i<n;i++){
		char c = s[i];
		if(!isalpha(c)) continue;
		if(islower(c)) res -= (c - 'a') + 1;
		if(isupper(c)) res += (c - 'A') + 1;
	}
	printf("%lld\n",res);
}

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
void read(int &digit)
{
	digit=0;
	char c;
	for (c=getchar();(c<'0' || c>'9') && c!='-';c=getchar());
	bool type=false;
	if (c=='-')
		type=true,c=getchar();
	for (;c>='0' && c<='9';digit=digit*10+c-'0',c=getchar());
	if (type==true)
		digit=-digit;
}

char s[1010];
int main()
{
	scanf("%s",s+1);
	int n=strlen(s+1);
	int mjy=0;
	for (int i=1;i<=n;i++)
	{
		if (s[i]<='Z' && s[i]>='A')	mjy+=s[i]-'A'+1;
		if (s[i]<='z' && s[i]>='a')	mjy-=s[i]-'a'+1;
	}
	printf("%d\n",mjy);
	return 0;
}

#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <queue>

#define fii(x,y) for(int i=x;i<y;i++)
#define fjj(x,y) for(int j=x;j<y;j++)
#define fkk(x,y) for(int k=x;k<y;k++)
#define fi(x) fii(0,x)
#define fj(x) fjj(0,x)
#define fk(x) fkk(0,x)
#define eps 0.0000000001
#define inf 1<<28

using namespace std;

typedef long long ll;
typedef vector <int> VI;
typedef vector <VI> VVI;
typedef vector <VVI> VVVI;
typedef vector <ll> VL;
typedef vector <VL> VVL;
typedef vector <double> VD;
typedef vector <VD> VVD;
typedef vector <bool> VB;
typedef vector <VB> VVB;
typedef queue <int> QI;
typedef pair<int,int> PI;
typedef pair<int,PI> PT;
typedef queue<PI> QPI;
typedef priority_queue<PT> QPT;
typedef pair<double,double> PD;

int main()
{
    string s;
    cin >> s;
    int ans = 0;
    fi (s.size())
    {
        if (s[i] > '@' and s[i] < ']')
            ans += s[i] - 'A' + 1;
        if (s[i] > '`' and s[i] < '{')
            ans -= s[i] - 'a' + 1;
    }
    cout << ans << endl;
}

#include <bits/stdc++.h>
using namespace std;
char s[55];
int main()
{
    int ans = 0;
    cin >> s;
    for(int i = 0; s[i]; i++)
        if(s[i] >= 'A' && s[i] <= 'Z')
            ans += s[i] - 'A' + 1;
        else if(s[i] >= 'a' && s[i] <= 'z')
            ans -= s[i] - 'a' + 1;
    cout << ans << endl;
    return 0;
}

#include<cstdio>
#include<cmath>
#include<stdlib.h>
#include<map>
#include<set>
#include<time.h>
#include<vector>
#include<stack>
#include<queue>
#include<string>
#include<string.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define eps 1e-8

char str[105];
int main()
{
    scanf("%s",str);
    int ans=0;
    for(int i=0;i<strlen(str);i++)
    {
        int i1=0,i2=0,i3=0;
        int a1='@',a2=str[i],a3='[',a4='`',a5='{';
//        printf("%d %d %d %d %d\n",a1,a2,a3,a4,a5);
        if((a1<a2)&&(a3>a2))
            i1=1;
        if((a4<a2)&&(a5>a2))
            i2=1;
        i3=tolower(a2)-'a'+1;
        ans=ans+i1*i3-i2*i3;
//        printf("%d\n",ans);
    }
    printf("%d\n",ans);
    return 0;
}

#include<iostream>
#include<cstring>
using namespace std;
char s[10001];
int ans;
int main(){
    cin >> s ;
    for(int i=0;i<strlen(s);i++){
        if(s[i]>='A'&&s[i]<='Z'){
            ans+=s[i]-'A'+1;
        }
        if(s[i]>='a'&&s[i]<='z'){
            ans-=s[i]-'a'+1;
        }
    }
    cout << ans ;
}

#include <stdio.h>
#include <ctype.h>

char s[100];
int res;

int main() {

	scanf("%s", s);
	for (int i = 0; s[i]; i++) {
		int n = 0;
		if (isupper(s[i]))
			n = s[i] - 'A' + 1;
		if (islower(s[i]))
			n = s[i] - 'a' + 1;
		int a = n * ('@' < s[i] && '[' > s[i]);
		int b = n * ('`' < s[i] && '{' > s[i]);
		res += a - b;
	}
	printf("%d", res);
}

#include<iostream>
#include<cstring>
using namespace std;
int main()
{
    string s;
    int ans=0;
    cin>>s;
    int l=s.length();
    for(int i=0;i<l;i++)
    {
        char c=s[i];
        int x=0,y=0;
        if(c>'@'&&c<'[') x=c-'@';
        if(c>'`'&&c<'{') y=c-'`';
        x-=y;
        ans+=x;
    }
    cout<<ans;
    return 0;
}

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <vector>
#include <utility>
#include <algorithm>
#include <string>
#include <cmath>
using namespace std;

int const MAX_N = 128 * 2;
long long const LL_INF = 1000000000000000009LL;
long long const MOD = 1000000007LL;

int main() {
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);

	string st;
	cin>>st;
	long long ans = 0;
	for (int mid=0; mid<((int) st.length()); mid++) {
		string a = "";
		a += (char) st[mid];

		int a_1 = 0;
		int a_1_arg_1 = ('@') < a[0];
		int a_1_arg_2 = ('[') > a[0];

		a_1 = a_1_arg_1 && a_1_arg_2;

		int a_2 = 0;
		int a_2_arg_1 = ('`') < a[0];
		int a_2_arg_2 = ('{') > a[0];

		a_2 = a_2_arg_1 && a_2_arg_2;

		int index = 0;
		if ((st[mid] >= 'a' && st[mid] <= 'z') || (st[mid] >= 'A' && st[mid] <= 'Z'))
			index = tolower(st[mid])-'a'+1;

		long long gg_1 = a_1 * index;
		long long gg_2 = a_2 * index;

		long long gg = gg_1 - gg_2;
		ans += gg;
	}

	cout<<ans;
	return 0;
}

#include <iostream>
#include <cstdio>
#include <unordered_map>
#include <cstring>
using namespace std;

unordered_map <char, int> small, big;

string s;

int main()
{
    small['a'] = 1;
    for(char x = 'b'; x <= 'z'; x++)
    {
        small[x] = small[x - 1] + 1;
    }
    big['A'] = 1;
    for(char x = 'B'; x <= 'Z'; x++)
    {
        big[x] = big[x - 1] + 1;
    }
    cin >> s;
    int a, b;
    a = b = 0;
    for(string::iterator it = s.begin(); it != s.end(); ++it)
    {
        if(*it >= 'A' && *it <= 'Z')//如果是大写，加上big[*it]的
        {
            a += big[*it];
        }
        if(*it >= 'a' && *it <= 'z')//如果是小写，加上small[*it]的
        {
            b += small[*it];
        }
    }
    printf("%d\n", a - b);
    return 0;
}

#include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
#include <cstring>
#include <algorithm>
#include <vector>
#include <sstream>
#include <set>
#include <stack>
#include <cctype>
#include <map>
using namespace std;
int GetAlphabetIndex(char chrCharacter){
	if (chrCharacter >= 'A' && chrCharacter <= 'Z')
		return chrCharacter - 'A' + 1;
	else if (chrCharacter >= 'a' && chrCharacter <= 'z')
		return chrCharacter - 'a' + 1;
	else
		return 0;
}
int main(){
	ios::sync_with_stdio(false);
	string sInput;
	long long iSum = 0, i,iTmp1,iTmp2;
	const char chr1 = '@';
	const char chr2 = '[';
	const char chr3 = '`';
	const char chr4 = '{';
	getline(cin, sInput);
	for (i = 0; i <= sInput.length() - 1; ++i){
		iTmp1 = (chr1<sInput[i]) & (chr2>sInput[i]);
		iTmp2 = (chr3<sInput[i]) & (chr4>sInput[i]);
		iSum += (iTmp1*GetAlphabetIndex(sInput[i]) - iTmp2*GetAlphabetIndex(sInput[i]));
	}
	cout << iSum;
	return 0;
}

#include <iostream>
#include <bitset>
#include <vector>
#include <set>
#include <map>

using namespace std;

int idx(char s) {
	return s - 'a';
}

int main() {
	string str;
	cin >> str;
	int sum = 0;
	for (int i = 0; i < str.length(); ++i) {
		int c = (str[i] >= 'A' && str[i] <= 'Z');
		int d = (str[i] >= 'a' && str[i] <= 'z');
		int f = c * (str[i] - 'A' + 1) - d * (str[i] - 'a' + 1);
		sum += f;
	}
	cout << sum;
	return EXIT_SUCCESS;
}

#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
#include <string>
#include <sstream>
#include <time.h>
#include <stdlib.h>
#include <queue>
#include <random>
#include <stack>
#include <cmath>

using namespace std;

vector<vector<int> > g;
bool used[123456];
bool isTree;
void dfs(int v, int p = -1)
{
	used[v] = 1;
	for(int i = 0; i < g[v].size(); ++i)
	{
		int to = g[v][i];
		if(!used[to])
			dfs(to, v);
		else if(to != p)
			isTree = 1;
	}
}

char a[20][20];

int main()
{
	cin.tie(0);
	ios_base::sync_with_stdio(0);
	string s;
	getline(cin, s);
	int ans = 0;
	for(int i = 0; i < s.size(); ++i)
	{
		char d = s[i];
		if(isalpha(d))
		{
			if(d >= 'A' && d <= 'Z')
				ans += d - 'A'+1;
			else
				ans -= d - 'a'+1;
		}
	}
	cout << ans;
	return 0;
}

/*
1 - 1
2 - 2
3 - 2
01010000000101011100
*/

#include <iostream>
using namespace std;

typedef long long ll;
char str[100005];

int main(){
    while(~scanf("%s",str)){
        int len = strlen(str);
        ll ans = 0;
        for(int i = 0; i < len; ++i){
            if(str[i] >= 'A' && str[i] <= 'Z')
                ans += str[i] - 'A' + 1;
            if(str[i] >= 'a' && str[i] <= 'z')
                ans -= str[i] - 'a' + 1;
        }
        cout<<ans;
    }
  return 0;
}

#pragma comment(linker, "/STACK:134217728")

#include <cstdio>
#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <string>
#include <complex>
#include <functional>
#include <cmath>
#include <time.h>

using namespace std;

typedef long long LL;

int main()
{
	string s;
	cin >> s;

	int res = 0;

	for (int i = 0; i < s.size(); ++i)
	{
		int a1 = '@' < s[i];
		int a2 = '[' > s[i];
		int b1 = '`' < s[i];
		int b2 = '{' > s[i];

		if ('a' <= s[i] && s[i] <= 'z')
		{
			int k = s[i] - 'a' + 1;

			int c = a1 * a2 * k;
			int d = b1 * b2 * k;
			res += c - d;
		}

		if ('A' <= s[i] && s[i] <= 'Z')
		{
			int k = s[i] - 'A' + 1;
			int c = a1 * a2 * k;
			int d = b1 * b2 * k;
			res += c - d;
		}

	}

	cout << res << endl;

	return 0;
}

#include <cstdio>
#include <string.h>
#include <algorithm>
#include <cmath>

using namespace std;

int n;
int res;
char str[51];

int main()
{
    scanf("%s", str);
    n = strlen(str);

    for(int i = 0; i<n; i++)
    {
        char s = str[i];
        bool a = s>64 and s<91;
        bool b = s>96 and s<123;

        int alpA = (s-64)*a;
        int alpa = (s-96)*b;

        res+= alpA-alpa;
    }

    printf("%d\n", res);

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    while( cin >> s)
    {
        int k = s.size(), sum = 0,x;

        for(int i=0; i<k; i++)
        {
            if(s[i] >= 'a' && s[i] <= 'z')
            {
                x = s[i]-96;
                sum-=x;
            }

            else if(s[i] >= 'A' && s[i] <= 'Z')
            {
                x = s[i]-64;
                sum+=x;
            }

            //cout << sum << endl;
        }

        cout << sum << endl;
    }
    return 0;
}

#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cctype>
#include<ctime>
#include<cstdlib>
#include<string>
#include<queue>
#include<cmath>
#include<set>
#include<map>
#include<bitset>
#include<vector>
#define Rep(x,a,b) for (int x=a;x<=b;x++)
#define Drp(x,a,b) for (int x=a;x>=b;x--)
#define Cross(x,a) for (int x=head[a];~x;x=next[x])
#define ll long long
#define INF (1<<29)
#define PII pair<int,int>
#define mk(a,b) make_pair(a,b)
#define fr first
#define sc second
using namespace std;
inline ll IN(){
	ll x=0;int ch=getchar(),f=1;
	while (!isdigit(ch)&&(ch!='-')&&(ch!=EOF)) ch=getchar();
	if (ch=='-'){f=-1;ch=getchar();}
	while (isdigit(ch)){x=(x<<1)+(x<<3)+ch-'0';ch=getchar();}
	return x*f;
}
inline void OUT(ll x){
	if (x<0) putchar('-'),x=-x;
	if (x>=10) OUT(x/10),putchar(x%10+'0');
		else putchar(x+'0');
}
char s[55];
int main(){
	scanf("%s",s+1);
	int Ret=0,n=strlen(s+1);
	Rep(i,1,n){
		if (s[i]=='.') continue;
		int Fr=0,Sc=0;
		if (s[i]>'@'&&s[i]<'[') Fr=s[i]-'A'+1;
		if (s[i]>'`'&&s[i]<'{') Sc=s[i]-'a'+1;
		Ret+=Fr-Sc;
	}
	OUT(Ret);
}

#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int maxn = 1000005;
const int MOD = 1e9 + 7;
char s[55];
int ans;
int main()
{
    gets(s);
    int n = strlen(s);
    for (int i=0; i<n; i++) {
        if (isupper(s[i])) {
            ans += s[i] - 'A' + 1;
        }else if (islower(s[i])) {
            ans -= s[i] - 'a' + 1;
        }
    }
    printf("%d\n", ans);
	return 0;
}

//#define MYDEBUG
#define _CRT_SECURE_NO_WARNINGS
#define TASK "radio"
#pragma comment(linker, "/STACK:536870912")
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <functional>
#include <cassert>
#include <bitset>
#include <unordered_set>
#include <unordered_map>
#include <random>

const int MOD = 1000000007;
const int INF = 1000000001;
const int MAXN = 100010;
const long double EPS = 1e-6;
const int HASH_POW = 29;
const long double PI = acos(-1.0);

using namespace std;

void my_return(int code)
{
#ifdef MYDEBUG
	cout << "\nTime = " << fixed << setprecision(3) << double(clock()) / CLOCKS_PER_SEC << endl;
#endif
	exit(code);
}

int main()
{
	cin.sync_with_stdio(0);
	cin.tie(0);
	mt19937 mt_rand(time(0));
#ifdef MYDEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#else
	/*freopen(TASK".in", "rt", stdin);
	freopen(TASK".out", "wt", stdout);*/
	/*freopen("input.txt", "rt", stdin);
	freopen("output.txt", "wt", stdout);*/
#endif

	string s;
	cin >> s;
	long long ans = 0;
	for (int i = 0; i < s.length(); ++i)
	{
		bool foo1 = false, foo2 = false;
		if (s[i] > '@' && s[i] < '[')
			foo1 = true;
		if (s[i] > '`' && s[i] < '{')
			foo2 = true;
		if (('A' <= s[i] && s[i] <= 'Z') || ('a' <= s[i] && s[i] <= 'z'))
		{
			int ind;
			if ('A' <= s[i] && s[i] <= 'Z')
				ind = s[i] - 'A' + 1;
			else
				ind = s[i] - 'a' + 1;
			if (foo1)
				ans += ind;
			if (foo2)
				ans -= ind;
		}
	}
	cout << ans << endl;

	my_return(0);
}

#include<bits/stdc++.h>

#define FI(i,a,b) for(int i=(a);i<=(b);i++)
#define FD(i,a,b) for(int i=(a);i>=(b);i--)

#define LL long long

using namespace std;

char a[55];

int len,res;

int main(){
  cin.getline(a,55);
  len=strlen(a);

  FI(i,0,len-1){
    if(a[i]>='A' && a[i]<='Z') res+=a[i]-'A'+1;
    else if(a[i]>='a' && a[i]<='z') res-=a[i]-'a'+1;
  }
  printf("%d\n",res);
  return 0;
}

#include <string>
#include <iostream>
#include <fstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <vector>

using namespace std;

int bla(char c){
    if (c >= 'a' && c <='z')
        return -c+'a'-1;
    if (c >= 'A' && c <='Z')
        return c-'A'+1;
    return 0;
}

int main() {
    string s;
    cin >> s;
    int ans = 0;
    for (int i = 0; i < s.length(); i++){
        ans += bla(s[i]);
    }
    cout << ans;
}

/*******************************\
   Name:    REAJUL HAQUE REAYZ  |
   School:  COMILLA UNIVERSITY  |
            CSE (5TH BATCH)     |
********************************/
#include<bits/stdc++.h>
#define endl "\n"
#define inf 1<<30
#define Pi acos(-1)
#define pb push_back
#define mp make_pair
#define ss stringstream
#define ll long long int
#define linf 100000000000000000
#define all(v) v.begin(), v.end()
#define mem(x,y) memset(x,y,sizeof(x))
#define bit_cnt(mask) __builtin_popcount(mask)
using namespace std;
template < class T > inline T gcd(T a,T b) {a=abs(a);b=abs(b); if(!b) return a; return __gcd(b,a%b);}
template < class T > inline T lcm(T a,T b) {a=abs(a);b=abs(b); return (a/__gcd(a,b))*b;}
#define MOD 1000000007
#define MAX 100005

char s[100];
int main()
{
	scanf("%s",s);
	int ans=0;
	for(int i=0;s[i];i++)
    {
		if(s[i]>='a'&&s[i]<='z')ans-=(s[i]-'a'+1);
		if(s[i]>='A'&&s[i]<='Z')ans+=(s[i]-'A'+1);
	}
	printf("%d\n",ans);
	return 0;
}

#pragma comment(linker,"/STACK:100000000000,100000000000")

#define _CRT_SECURE_NO_WARNINGS

#include <bits/stdc++.h>

#define ll long long
#define pb push_back
#define mp make_pair
#define D long double
#define pi pair<int,int>
#define F first
#define S second
#define forn(i,n) for (int(i)=0;(i)<(n);i++)
#define forr(i,x,y) for (int(i)=(x);(i)<=(y);i++)
#define ford(i,x,y) for (int(i)=(x);(i)>=(y);i--)
#define rev reverse
#define in insert
#define er erase
#define all(n) (n).begin(),(n).end()
#define graf vector<vector<pi> >
#define graf1 vector<vector<ll> >
#define sqr(a) (a)*(a)
#define file freopen("password.in","r",stdin);freopen("password.out","w",stdout);
#define y1 asdadasdasd

const int INF = 1e9;
const D cp = 2 * asin(1.0);
const D eps = 1e-9;
const ll mod = 1000000007;

using namespace std;

int main()
{
    cin.tie(0);
    ios_base::sync_with_stdio(0);
    string s;
    cin>>s;
    int k=0,p=0;
    forn(i,s.size())
    {
        if (s[i]>='A' && s[i]<='Z') k+=s[i]-'A'+1;
        if (s[i]>='a' && s[i]<='z') p+=s[i]-'a'+1;
    }
    cout<<k-p;
    return 0;
}

// <C.cpp> - 04/03/16 04:11:14
// This file is created by XuYike's black technology automatically.
// Copyright (C) 2015 ChangJun High School, Inc.
// I don't know what this program is.

#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <cmath>
using namespace std;
typedef long long lol;
int getint(){
	int res=0,fh=1;char ch=getchar();
	while((ch>'9'||ch<'0')&&ch!='-')ch=getchar();
	if(ch=='-')fh=-1,ch=getchar();
	while(ch>='0'&&ch<='9')res=res*10+ch-'0',ch=getchar();
	return fh*res;
}
string s;
const char a1='@',a2='[',a3='`',a4='{';
lol res;
int id(char c){
    if(c>='A'&&c<='Z')return c-'A'+1;
    if(c>='a'&&c<='z')return c-'a'+1;
}
int main(){
	getline(cin,s);
    int l=s.size();
    for(int i=0;i<l;i++){
        bool flag1=(a1<s[i])&(a2>s[i]);
        bool flag2=(a3<s[i])&(a4>s[i]);
        res+=(flag1*id(s[i]))-(flag2*id(s[i]));
    }
    printf("%I64d",res);
	return 0;
}

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<string>
#include<cstdlib>
using namespace std;
int ans;
string a;
int main(){
    cin>>a;
    for(int i=0;i<a.length();i++){
        if(isupper(a[i])) ans+=a[i]-64;
        if(islower(a[i])) ans-=a[i]-96;
    }
	cout<<ans;
    return 0;
}//hello

#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <cctype>
#include <algorithm>
#include <iterator>
#include <map>
#include <vector>
#include <list>
#include <set>
#include <queue>
#include <cassert>
#include <deque>
#include <stack>
#include <bitset>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iomanip>
#include <cstring>
#include <cmath>
#include <ctime>
#include <limits>

using namespace std;

#define LET(x,a)        ::typeid(a) x(a)
#define IFOR(i,a,b)     for(LET(i,a);i!=(b);++i)
#define EACH(it,v)      IFOR(it,v.begin(),v.end())
#define FOR(i,a,b)      for(int i = (a); i < int(b);i++)
#define REP(i,n)        FOR(i,0,n)
#define SZ              size()
#define PB              push_back
#define PF              push_front
#define V(x)            vector< x >
#define two(X)          (1<<(X))
#define twoL(X)         (((int64)(1))<<(X))
#define contain(S,X)    (((S)&two(X))!=0)
#define containL(S,X)   (((S)&twoL(X))!=0
#define swap(x,y)       x ^=y ^= x^=y
#define ALL(v)          (v).begin(),(v).end()

const double pi = acos(-1.0);
const double eps = 1e-11;
const int oo = 0x3f3f3f3f;
template<class T> inline void checkmin(T &a, T b){ if (b<a) a = b; }
template<class T> inline void checkmax(T &a, T b){ if (b>a) a = b; }
template<class T> inline T sqr(T x){ return x*x; }
typedef pair<int, int> ipair;
template<class T> inline T lowbit(T n){ return (n ^ (n - 1))&n; }
template<class T> inline int countbit(T n){ return (n == 0) ? 0 : (1 + countbit(n&(n - 1))); }
template<class T> inline T gcd(T a, T b) { T c; while (a != 0) { c = a; a = b%a;  b = c; } return b; }
template<class T> inline T mabs(T a) { if (a < 0) return -a; else return a; }

typedef V(int)          VI;
typedef V(VI)           VII;
typedef V(string)       VS;
typedef long long       int64;
typedef long double     LD;
typedef pair<int, int>   PI;

#pragma comment(linker,"/STACK:36777216")

//#define LocalHost
int TEST_TO;
int TEST_FROM;
inline int index(char c) {
	return (c >= 'a' ? c - 'a' : c - 'A') + 1;
}
inline int solve(int testnum)
{
#ifdef LocalHost
	if (testnum < TEST_FROM || testnum > TEST_TO) return -1;
#endif
	string s; cin >> s;
	int64 ret = 0LL;
	int len = (int)s.SZ;
	REP(i, len) {
		int r1 = (s[i] > '@' && s[i] < '[') ? 1 : 0;
		int r2 = (s[i] > '`' && s[i] < '{') ? 1 : 0;
		int a1 = index(s[i]) * r1;
		int a2 = index(s[i]) * r2;
		int r = a1 - a2;
		ret += r;
	}
	printf("%I64d\n", ret);
	return 0;
}
int main(int argc, char* argv[])
{
#ifdef LocalHost
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	ios::sync_with_stdio(false);
	int t = 1;
	if (argc > 1) t = atoi(argv[1]);
	TEST_FROM = 1;
	TEST_TO = t;
	FOR(_t, 1, t + 1) {
		int ret = ::solve(_t);
		if (ret == -1) break;
	}
#ifdef LocalHost
	printf("Time taken : %.10f seconds\n", (1.0f*clock()) / CLOCKS_PER_SEC);
#endif
	return 0;
}

// In the name of GOD
#include <bits/stdc++.h>

using namespace std;

#define int long long

int res, n;
string s;
main()
{
	cin>>s;
	n = s.length();
	for(int i = 0; i < n;++i) {
		int x = '@'<s[i] && '[' > s[i];
		int y = tolower(s[i])-'a'+1;
		int z = '`'<s[i] && '{' > s[i];
		res += x*y-z*y;
		//cerr<<s[i]<<' '<<x<<' '<<y<<' '<<z<<'\n';
		//cerr<<i<<'\t'<<res<<'\n';
	}
	cout<<res;
}

#include <bits/stdc++.h>

#define gc getchar unlocked
#ifndef ONLINE JUDGE
#define gc getchar
#endif // ONLINE JUDGE

#define pc putchar_unlocked
#ifndef ONLINE JUDGE
#define pc putchar
#endif // ONLINE JUDGE

#define eps 1e-8
#define inf 0x3f3f3f3f
#define INF 2e18
#define LL long long
#define ULL unsigned long long
#define PI acos(-1.0)
#define pb push_back
#define mk make_pair
#define pii pair<int,int>
#define pLL pair<LL,LL>
#define ff first
#define ss second
#define all(a) a.begin(),a.end()
#define SQR(a) ((a)*(a))
#define Unique(a) sort(all(a)),a.erase(unique(all(a)),a.end())

using namespace std;

const int MOD = 1e9 + 7;
int fx[] = {+1,-1,+0,+0,+1,+1,-1,-1,+0};
int fy[] = {+0,+0,+1,-1,+1,-1,+1,-1,+0};
template <typename T> inline T GCD (T a,T b ) {a = abs(a);b = abs(b);while ( b ) { a = a % b; swap ( a, b ); } return a;}
template <typename T> inline T LCM(T x,T y){T tp = GCD(x,y);if( (x / tp) * 1. * y > 9e18) return 9e18;return (x / tp) * y;}
/*---------------------------fast I/O------------------------------------*/
#define scani2(a,b) scani(a) , scani(b)
#define scani3(a,b,c) scani(a), scani(b), scani(c)
#define scani4(a,b,c,d) scani(a), scani(b), scani(c), scani(d)
template <typename T> bool scani(T &n){n = 0;bool got = false;bool negative = false;char c = gc();while( c < '0' || c > '9'){if(c == '-') negative = true;c = gc();}while(c >= '0' && c <= '9'){got = true;n = n*10 + c-48;c = gc();}if(negative) n = ~(n-1);return got;}
template <typename T> void write(T n,bool line = true){if(n<0) {pc('-');n = -n;}if(!n) {pc('0');if(line) pc('\n');return;}char buff[22];int len = 0;while(n) buff[len++] = n%10+48,n/=10;for(int i=len-1;i>=0;i--) pc(buff[i]);if(line) pc('\n');}
int scans(char *a){int i=0;char c = 0;while(c < 33) c = gc();while(c > 33){a[i++] = c;c = gc();}a[i] = 0;return i;}
/*********************************************** End of template *********************************************/

int main()
{
    string s;
    cin >> s;
    int siz = s.size();
    int ans = 0 ;
    for(int i=0;i<siz;i++){
        if(!isalpha(s[i])) continue;
        int tp = tolower(s[i]) - 'a' + 1;
        if(islower(s[i])) tp = -tp;
        ans += tp;
    }
    write(ans);
    return 0;
}

#include <iostream>
#include <cstring>
typedef long long ll;
using namespace std;
ll ans = 0;
int Alphabet(char x)
{
    if (x >= 'a' && x <= 'z'){
        return x - 'a' + 1;
    }
    if (x >= 'A' && x <= 'Z'){
        return x - 'A' + 1;
    }
}
int main()
{
    string s;
    char a = '@',b = '[',c = '`',d = '{';
    cin >> s;
    for (int i = 0; i < s.size(); i++){
        int f1 = (a < s[i] & b > s[i]);
        int f2 = (c < s[i] & d > s[i]);
        ans += (f1 * Alphabet(s[i])) - (f2 * Alphabet(s[i]));
    }
    cout << ans;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;

#define debug(args...) fprintf(stderr,args)
#define pb push_back
#define mp make_pair

typedef long long ll;

const int N = 5e6 + 5;
const ll inf = 1791791791;
const ll mod = 1e9+7;

int main() {
	string s;
	cin >> s;
	int res = 0;
	for (int i=0;i<s.size();i++) {
		bool a1 = '@' < s[i];
		bool a2 = '[' > s[i];
		bool a3 = '`' < s[i];
		bool a4 = '{' > s[i];
		a1 = a1 && a2;
		a3 = a3 && a4;
		int j = 0;
		if (s[i] <= 'z' && s[i] >= 'a') j = s[i]-'a'+1;
		if (s[i] <= 'Z' && s[i] >= 'A') j = s[i]-'A'+1;
		int j1 = a1, j2 = a3;
		res += j1*j - j*j2;
	}
	printf("%d\n", res);
    return 0;
}

#include<bits/stdc++.h>

#define PB push_back
#define remove erase
#define endl '\n'
#define FOR(in,n) for(int i = in;i < n;i++)
#define MAX

using namespace std;

typedef long long ll;

typedef pair<int,int> pii;
typedef pair<int,ll> pll;
typedef pair<int,double> pid;
typedef vector<int> vi;

int main()
{
    ios_base :: sync_with_stdio(0);
    cin.tie(0);

	string a;
	cin >> a;
	int l = a.size();
	ll s1 = 0;
	ll s2 = 0;
	for(int i = 0 ; i < l; i++){
		if(a[i] >= 'a' && a[i] <= 'z')
			s2 += (a[i] - 'a' + 1);
		else if(a[i] >= 'A' && a[i] <= 'Z')
		    s1 += (a[i] - 'A' + 1);
	}
	cout << s1 - s2 << endl;

}

#include<bits/stdc++.h>
#define lo long long int
using namespace std;
int main(){
	string s;
	cin>>s;
	lo sum=0;
	for (char i:s){
		if (i>='A' and i<='Z')sum+=i-'A'+1;
		if (i>='a' and i<='z')sum-=i-'a'+1;
	}
	cout<<sum;
}

#include <bits/stdc++.h>

using namespace std;

int n;
string s;

int main()
{
    cin >> s;
    n = s.size();
    int ans = 0;
    for(int i = 0; i < n; i++)
        if(s[i] >= 'a' && s[i] <= 'z')
            ans -= (s[i] - 'a' + 1);
        else if(s[i] >= 'A' && s[i] <= 'Z')
            ans += (s[i] - 'A' + 1);
    cout << ans << "\n";
    return 0;
}

#include<iostream>
#include<algorithm>
#include<string>
#include<cstring>
#include<cstdio>
#include<stdio.h>
#include<cmath>
#include<math.h>
#include<vector>
#include<set>
#include<queue>
#include<map>
#define forn(i,n) for(int (i)=0;i<(n);i++)
#define pb push_back
#define mp make_pair
using namespace std;
typedef pair<int,int>pii;
typedef long long ll;
typedef pair<ll,ll> pll;
const int MAXN=100005;
const int INF=2147483647;
const ll LINF=9223372036854775807;
const int dx[]={1,-1,0,0},dy[]={0,0,1,-1};
string s;
int ans;
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cin>>s;
	forn(i,s.size())
	{
		ans-=(s[i]>='a'&&s[i]<='z')*(s[i]-'a'+1);
		ans+=(s[i]>='A'&&s[i]<='Z')*(s[i]-'A'+1);
	}
	cout<<ans;
	return 0;
}

#include<iostream>
using namespace std;
int sum;
int main()
{
	string a; cin>>a;
	for(int i=0;i<=a.size()-1;i++)
	{
		if(a[i]>='A'&&a[i]<='Z')
		  sum+=a[i]-'A'+1;
		if(a[i]>='a'&&a[i]<='z')
		  sum-=a[i]-'a'+1;
	}
	cout<<sum;

	return 0;
}

#include <bits/stdc++.h>

#define all(a) 			a.begin(), a.end()
#define mid(x,y) 		int mid = (x+y)/2
#define FOR(i,s,e) 		for(int i = s; i < e; i++)
#define REV(i,e,s)		for(int i = s-1; i >= e; i--)
#define STEP(i,s,e,j)	for(int i = s; i < e; i+=j)
#define FORIT(type,a) 	for(type::iterator it = a.begin(); it != a.end(); it++)
#define FOREACH(a) 		for(unsigned int i = 0; i < a.size(); i++)
#define pb 				push_back
#define mp				make_pair

using namespace std;

typedef long long ll;

int mineq(int &a, int b){return a>b?a=b,true:false;}
int maxeq(int &a, int b){return a<b?a=b,true:false;}

const int MAXN = 1e5 + 100;

int main()
{
	ios_base::sync_with_stdio(false);
	string str;
	cin >> str;
	int res = 0;
	FOR(i,0,str.size())
	{
		int num;
		if(str[i] >= 'A' && str[i] <= 'Z')
			num = str[i] - 'A' + 1;
		else
			num = str[i] - 'a' + 1;
		int s = 0;
		if('@' < str[i] && '[' > str[i])
			s += num;
		if('`' < str[i] && '{' > str[i])
			s -= num;
		res = s + res;
	}
	cout << res;
	return 0;
}

#include <cstdio>
#include <cctype>

int main() {
    char s[60];
    scanf("%s", s);
    int res = 0;
    for (int i = 0; s[i]; i++) {
        if (s[i] == '.') continue;
        if (!isalpha(s[i])) continue;
        int idx = (isupper(s[i]) ? s[i] - 'A' : s[i] - 'a') + 1;
        int a = ('@' < s[i] && '[' > s[i]) * idx;
        int b = ('`' < s[i] && '{' > s[i]) * idx;
        res += (a - b);
    }
    printf("%d\n", res);
}

#include <bits/stdc++.h>
using namespace std;
string s;
int ans = 0;
int main()
{
	cin >> s;
	for (int i = 0; i < s.length(); i++)
		if (s[i] >= 'A' && s[i] <= 'Z') ans += s[i] - '@';
		else if (s[i] >= 'a' && s[i] <= 'z') ans -= s[i] - '`';
	printf("%d\n", ans);
	return 0;
}

#include <iostream>
#include <string>
using namespace std;
int main(){
    string str;
	cin >> str;
    int sum = 0;
    for(int i = 0; i < str.size(); i++) {
        if('A' <= str[i] && str[i] <= 'Z')
			sum += (str[i] - 'A' + 1);
        if('a' <= str[i] && str[i] <= 'z')
			sum -= (str[i] - 'a' + 1);
		cout << sum << endl;
    }
    cout << sum << endl;
    return 0;
}

#include <bits/stdc++.h>
#define ll long long
using namespace std;

const int INF = INT_MAX, N = 1e2 + 7;

int main()
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    string s;
    int ans = 0;
    cin >> s;
    for (int i = 0; i < s.size(); ++i){
        if (s[i] <= 'Z' && s[i] >= 'A'){
            ans += s[i] - 'A' + 1;
        }
        else {
            if (s[i] >= 'a' && s[i] <'z'){
                ans -= s[i] - 'a' + 1;
            }
        }
    }
    cout << ans;

    return 0;
}

#include <bits/stdc++.h>
#define ll long long
using namespace std;

const int INF = INT_MAX, N = 1e2 + 7;

int main()
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    string s;
    int ans = 0;
    cin >> s;
    for (int i = 0; i < s.size(); ++i){
        if (s[i] <= 'Z' && s[i] >= 'A'){
            ans += (s[i] - 'A' + 1);
        }
        else {
            if (s[i] >= 'a' && s[i] <'z'){
                ans -= (s[i] - 'a' + 1);
            }
        }
    }
    cout << ans;

    return 0;
}

#include <bits/stdc++.h>
using namespace std;

#define fro(i, n) for (int i = 0; i < int(n); i++)
#define ll long long
#define pb push_back
#define in insert
#define F first
#define S second
#define E endl
#define R return 0

int main()
{
    string s;
    cin >> s;

    int ans = 0;
    for (int i = 0; i < s.length(); i++)
    {
        if (s[i] >= 'a' && s[i] <= 'z')
            ans -= (s[i] - 'a') + 1;

        else if (s[i] >= 'A' && s[i] <= 'Z')
            ans += (s[i] - 'A') + 1;

        cout << ans << E;
    }

    cout << ans;
}

#include<iostream>
using namespace std;
int main(){
    string s;
    getline(cin,s);
    long long ans=0;
    for(int i=0; i<s.size() ;i++){
        if(s[i]>=65 && s[i]<=90){
            ans+=s[i]-64;
        }
        else if(s[i]>=97 && s[i]<=122){
            ans-=s[i]+96;
        }
    }
    cout << ans << endl;
}

#include <bits/stdc++.h>

using namespace std;

int main()
{
    string str;
    cin >> str;
    auto it = str.begin();
    while (it != str.end() && *it == 'a') ++it;
    if (it == str.end())
    {
        str.back() = 'z';
    }
    else
    {
        while (it != str.end() && *it != 'a')
        {
            --(*it);
            ++it;
        }
    }
    cout << str;
}

#include<bits/stdc++.h>
using namespace std;
int ans;
char a[10001];
int main(){
    scanf("%s",a);
    int r=strlen(a);
    for(int i=1;i<=r;i++){
        if((a[i]>='A')&&(a[i]<='Z')) ans+=a[i]+1-'A';
        if((a[i]>='a')&&(a[i]<='z')) ans-=a[i]+1-'a';
    }
    printf("%d",ans);
    return 0;
}

#include<cstdio>
#include<cmath>
#include<stdlib.h>
#include<map>
#include<set>
#include<time.h>
#include<vector>
#include<stack>
#include<queue>
#include<string>
#include<string.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define eps 1e-8

char str[105];
int main()
{
    scanf("%s",str);
    int ans=0;
    for(int i=0;i<strlen(str);i++)
    {
        int i1=0,i2=0,i3=0;
        int a1='@',a2=str[i],a3='[',a4='`Co',a5='{';
//        printf("%d %d %d %d %d\n",a1,a2,a3,a4,a5);
        if((a1<a2)&&(a3>a2))
            i1=1;
        if((a4<a2)&&(a5>a2))
            i2=1;
        i3=tolower(a2)-'a'+1;
        ans=ans+i1*i3-i2*i3;
//        printf("%d\n",ans);
    }
    printf("%d\n",ans);
    return 0;
}

#include <cstdio>
#include <cstring>

using namespace std;

int main()
{
    char s[51];
    int ans = 0;

    scanf("%s", s);

    for (int i = 0; i < strlen(s); i++)
    {
        if (s[i] == '.')
            ans += 1;
        else if ('A' <= s[i] && s[i] <= 'Z')
            ans = ans + (s[i] - 'A') + 1;
        else if ('a' <= s[i] && s[i] <= 'z')
            ans = ans - (s[i] - 'a') - 1;
        else if ('0' <= s[i] && s[i] <= '9')
            ans = ans - (s[i] - '0');
    }

    printf("%d", ans);

    return 0;
}

#include <cstdio>
#include <cstring>

using namespace std;

int main()
{
    char s[51];
    int ans = 0;

    scanf("%s", s);

    for (int i = 0; i < strlen(s); i++)
    {
        if (s[i] == '.')
            ans -= 1;
        else if ('A' <= s[i] && s[i] <= 'Z')
            ans = ans + (s[i] - 'A') + 1;
        else if ('a' <= s[i] && s[i] <= 'z')
            ans = ans - (s[i] - 'a') - 1;
        else if ('0' <= s[i] && s[i] <= '9')
            ans = ans + (s[i] - '0');
    }

    printf("%d", ans);

    return 0;
}

/* "In the name of Allah" */
#include <bits/stdc++.h>
using namespace std;
int main() {
    ios_base::sync_with_stdio(0), cin.tie(0);
    string s;
	cin >> s;
    int ans = 0;
    for (char c: s)
        c >= 'a'? ans -= c - 'a' + 1: ans += c - 'A' + 1;
    cout << ans << endl;
}

#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <algorithm>
#include <set>
#include <map>
#include <cmath>
using namespace std;
typedef long long ll;
typedef long double ld;
const ll inf = 1e+9 + 7;

int main() {
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	ll n, i, j = 0;
	string s;
	char c;
	cin >> s;
	for (i = 0; i < s.size(); ++i) {
		c = s[i];
		j += (c >= 'a' ? c - 'a' + 1 : c - 'A' + 1) * ((int)(c > '@' && c < ']') - (int)(c > '`' && c < '{'));
	}
	cout << j;
	return 0;
}

#include <cstdio>
#include <iostream>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <memory.h>

#include <vector>
#include <queue>

using namespace std;
int  n, m;
char d[16][16];

int main() {
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	//int t;
	string s;
	cin >> s;
	int res = 0;
	for (int i = 0; i < s.length(); i++) {
		int ind = 0;
		if ('a' <= s[i] && s[i] <= 'z')
			ind = s[i] - 'a' + 1;
		if ('A' <= s[i] && s[i] <= 'Z')
			ind = s[i] - 'A' + 1;

			res += int('[' > s[i] && '@' < s[i]) * ind - int('a' < s[i] && '}' > s[i]) * ind;
	}
		cout << res;

	/*cin >> n >> m >> t;
	for (int i = 0; i < n; i++)
		for (int j = 0; j < m; j++)
		cin >> d[i][j];
	int res = 0;
	for (int j = 0; j < m; j++) {
		int sm = 0;
		for (int i = 0; i < n; i++)
			if (d[i][j] == 'Y')
				sm++;
		if (sm >= t)
			res++;
	}
	cout << res;
	/*cin >> n;
	for (int i = 0; i < n; i++)
		for (int j = 0; j < n; j++)
			cin >> d[i][j];
	for (int k = 0; k<n; ++k)
		for (int i = 0; i<n; ++i)
			for (int j = 0; j<n; ++j)
				d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
	int res = 0;
	for (int i = 0; i < n; i++)
		for (int j = 0; j < n; j++)
			res = max(res, d[i][j]);
			cout << res;*/
}

#include <cstdio>
#include <iostream>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <memory.h>

#include <vector>
#include <queue>

using namespace std;
int  n, m;
char d[16][16];

int main() {
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	//int t;
	string s;
	cin >> s;
	int res = 0;
	for (int i = 0; i < s.length(); i++)
	if (s[i] != '.' && !('0' <= s[i] && s[i] <= '9')) {
		int ind = 0;
		if ('a' <= s[i] && s[i] <= 'z')
			ind = s[i] - 'a' + 1;
		if ('A' <= s[i] && s[i] <= 'Z')
			ind = s[i] - 'A' + 1;

			res += int('[' > s[i] && '@' < s[i]) * ind - int('a' < s[i] && '}' > s[i]) * ind;
	}
		cout << res;

	/*cin >> n >> m >> t;
	for (int i = 0; i < n; i++)
		for (int j = 0; j < m; j++)
		cin >> d[i][j];
	int res = 0;
	for (int j = 0; j < m; j++) {
		int sm = 0;
		for (int i = 0; i < n; i++)
			if (d[i][j] == 'Y')
				sm++;
		if (sm >= t)
			res++;
	}
	cout << res;
	/*cin >> n;
	for (int i = 0; i < n; i++)
		for (int j = 0; j < n; j++)
			cin >> d[i][j];
	for (int k = 0; k<n; ++k)
		for (int i = 0; i<n; ++i)
			for (int j = 0; j<n; ++j)
				d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
	int res = 0;
	for (int i = 0; i < n; i++)
		for (int j = 0; j < n; j++)
			res = max(res, d[i][j]);
			cout << res;*/
}

#include <cstdio>
#include <iostream>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <memory.h>

#include <vector>
#include <queue>

using namespace std;

int main() {
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

	string s;
	cin >> s;
	int res = 0;
	for (int i = 0; i < s.length(); i++)
	if (s[i] != '.' && !('0' <= s[i] && s[i] <= '9')) {
		int ind = 0;
		if ('a' <= s[i] && s[i] <= 'z')
			ind = s[i] - 'a' + 1;
		if ('A' <= s[i] && s[i] <= 'Z')
			ind = s[i] - 'A' + 1;

			res += int('[' > s[i] && '@' < s[i]) * ind - int('\'' < s[i] && '}' > s[i]) * ind;
	}
		cout << res;

}

#include <cstdio>
#include <iostream>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <memory.h>

#include <vector>
#include <queue>

using namespace std;

int main() {
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

	string s;
	cin >> s;
	int res = 0;
	//cout << int('\'') << '\n';
	for (int i = 0; i < s.length(); i++)
	if (s[i] != '.' && !('0' <= s[i] && s[i] <= '9')) {
		int ind = 0;
		if ('a' <= s[i] && s[i] <= 'z')
			ind = s[i] - 'a' + 1;
		if ('A' <= s[i] && s[i] <= 'Z')
			ind = s[i] - 'A' + 1;

			res += int('[' > s[i] && '@' < s[i]) * ind - int(39 < s[i] && '}' > s[i]) * ind;
	}
		cout << res;

}

#include <cassert>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <climits>
#include <limits>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <set>
#include <list>
#include <unordered_set>
#include <unordered_map>
#include <map>
#include <bitset>
#include <deque>
#include <queue>
#include <forward_list>
#include <stack>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <utility>

using namespace std;
typedef unsigned long long int ulint;
typedef long long int lint;
typedef pair<int,int> pi;
typedef pair<lint,lint> pl;
typedef vector<int> vi;

struct dbg_ {
	template<typename T> dbg_ & operator ,(const T & x) {
		cout << x << ' ';
		return *this;
	}
} dbg_t;

#define EPS 0.0000001
#define REP(i,a,b) for(int i=a;i<b;i++)
#define PER(i,a,b) for(int i=a;i>b;i--)
#define REPi(type,cont,a) for (type<int>::iterator a = cont.begin(); a!=cont.end(); ++a)
#define REPs(cont,a) for (set<int>::iterator a = cont.begin(); a!=cont.end(); ++a)
#define ABS(x) ((x)<0?-(x):(x))
#define FABS(x) ((x)+eps<0?-(x):(x))
#define MIN(X, Y)  ((X) < (Y) ? (X) : (Y))
#define MAX(X, Y)  ((X) > (Y) ? (X) : (Y))
#define NUMDIGIT(x,y) (((int)(log10((x))/log10((y))))+1)
#define MP make_pair
#define PB push_back
#define ALL(a) a.begin(), a.end()
#define HAS(a,b) (a.find(b) != a.end())
#define fi first
#define se second
#ifdef SLONICHOBOT
	#undef dbg
	#undef tu
	#define tu cout << "#line: " << __LINE__ << endl
	#define dbg(args ...) { cout << "|" << __LINE__ << "| "; dbg_t,args;cout << endl; }
	#define dbgg(X) cerr << #X ": " << X << endl
#else
	#define tu
	#define dbg
	#define dbgg
#endif

int main()
{
	string str; cin >> str;
	lint ret = 0;
	for(auto i: str) ret += isupper(i)*((int)i-64) - islower(i)*((int)i-96);
	cout << ret << endl;
	return 0;
}

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <cstring>
#include <ctime>
#include <deque>
#include <forward_list>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream> // istringstream buffer(myString);
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef pair<int,int> pi;
typedef pair<ll,ll> pl;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pi> vpi;
struct dbg_ {template<typename T> dbg_ & operator ,(const T & x) { cerr << x << ' '; return *this;}} dbg_t;
struct cin_ {template<typename T> cin_ & operator ,(T & x) { cin >> x; return *this;}} cin_;
template <typename T1, typename T2>
static inline ostream & operator<<(ostream & os, std::pair<T1, T2> const& p) {
    os << "{" << p.first << ", " << p.second  << "}";return os;
}
#define sync ios_base::sync_with_stdio(0) //to synchronize the input of cin and scanf

#define inf 2000000007
#define eps 1e-9
#define popcnt __builtin_popcount
#define gcd __gcd

#define rep(i,n) for(int i=0, _##i=(n); i<_##i; ++i)
#define dwn(i,n) for(int i=(n); --i>=0; )
#define repr(i,l,r) for(int i=(l), _##i=(r); i<_##i; ++i)
#define dwnr(i,l,r) for(int i=(r), _##i=(l); --i>=_##i; )
#define repa(i,a) for(auto i : a)
#define rd(args...) { cin_,args; }

#define mp make_pair
#define pb push_back
#define x first
#define y second
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define in(b,a) ((a).find(b) != (a).end())
#define index(a,x) (lower_bound(all(a),x)-arr.begin())
#define fill(a,v) memset(a, v, sizeof(a))
#define clr(a) memset(a, 0, sizeof(a))
#define rda(a,n) rep(i,n){cin>>a[i];}
#define sz(a) ((int)(a.size()))

#define remax(a,b) (a)=max((a),(b))
#define remin(a,b) (a)=min((a),(b))
#define remax2(a,b,ai,bi) do{if((a)>(b)){a=b;ai=bi;}}while(0)
#define remin2(a,b,ai,bi) do{if((a)<(b)){a=b;ai=bi;}}while(0)
#define checkbit(n,b) ((n >> b) & 1)

#ifdef SLONICHOBOT
	#define tu cerr << "#line: " << __LINE__ << endl
	#define dbg(args ...) { cerr << "|" << __LINE__ << "| "; dbg_t,args;cerr << endl; }
	#define dbgg(X) cerr << #X ": " << X << endl
	#define debug(args...) do {cerr << #args << ": "; dbg_t,args; cerr << endl;} while(0)
	#define dbga(a,n) rep(i,n)cerr<<a[i]<<" ";cerr<<endl
	#define dbgc(a) repa(i,a)cerr<<a[i]<<',';cerr<<endl
#else
	#define tu
	#define dbg
	#define dbgg
	#define debug
	#define dbga
	#define dbgc
#endif

int main()
{
	string str; cin >> str;
	ll ret = 0;
	for(auto i: str) ret += isupper(i)*((int)i-'A'+1) - islower(i)*((int)i-'a'+1);
	cout << ret << endl;
	return 0;
}

#include <cassert>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <climits>
#include <limits>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <set>
#include <list>
#include <unordered_set>
#include <unordered_map>
#include <map>
#include <bitset>
#include <deque>
#include <queue>
#include <forward_list>
#include <stack>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <utility>

using namespace std;
typedef unsigned long long int ulint;
typedef long long int lint;
typedef pair<int,int> pi;
typedef pair<lint,lint> pl;
typedef vector<int> vi;

struct dbg_ {
	template<typename T> dbg_ & operator ,(const T & x) {
		cout << x << ' ';
		return *this;
	}
} dbg_t;

#define EPS 0.0000001
#define REP(i,a,b) for(int i=a;i<b;i++)
#define PER(i,a,b) for(int i=a;i>b;i--)
#define REPi(type,cont,a) for (type<int>::iterator a = cont.begin(); a!=cont.end(); ++a)
#define REPs(cont,a) for (set<int>::iterator a = cont.begin(); a!=cont.end(); ++a)
#define ABS(x) ((x)<0?-(x):(x))
#define FABS(x) ((x)+eps<0?-(x):(x))
#define MIN(X, Y)  ((X) < (Y) ? (X) : (Y))
#define MAX(X, Y)  ((X) > (Y) ? (X) : (Y))
#define NUMDIGIT(x,y) (((int)(log10((x))/log10((y))))+1)
#define MP make_pair
#define PB push_back
#define ALL(a) a.begin(), a.end()
#define HAS(a,b) (a.find(b) != a.end())
#define fi first
#define se second
#ifdef SLONICHOBOT
	#undef dbg
	#undef tu
	#define tu cout << "#line: " << __LINE__ << endl
	#define dbg(args ...) { cout << "|" << __LINE__ << "| "; dbg_t,args;cout << endl; }
	#define dbgg(X) cerr << #X ": " << X << endl
#else
	#define tu
	#define dbg
	#define dbgg
#endif

int main()
{
	string str; cin >> str;
	int ret = 0;
	for(auto i: str) ret += isupper(i)*(i-'@') - islower(i)*(i-'`');
	cout << ret << endl;
	return 0;
}

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

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

/*
*   Copyright (C) 2016 All rights reserved.
*
*   filename: 656C.cpp
*   author: doublehh
*   e-mail: sserdoublehh@foxmail.com
*   create time: 2016-04-02 00:18:38
*   last modified: 2016-04-02 00:18:38
*/
#include<bits/stdc++.h>
using namespace std;

char s[51];

int main()
{
	scanf("%s", s);
	int ans = 0;
	for (int i = 0; s[i]; i++)
	{
		if (islower(s[i])) ans -= s[i] - 'a' + 1;
		if (isupper(s[i])) ans -= s[i] - 'A' + 1;
	}
	printf("%d\n", ans);
}

/*
*   Copyright (C) 2016 All rights reserved.
*
*   filename: 656C.cpp
*   author: doublehh
*   e-mail: sserdoublehh@foxmail.com
*   create time: 2016-04-02 00:18:38
*   last modified: 2016-04-02 00:18:38
*/
#include<bits/stdc++.h>
using namespace std;

char s[51];

int main()
{
	scanf("%s", s);
	int ans = 0;
	for (int i = 0; s[i]; i++)
	{
		if (islower(s[i])) ans -= s[i] - 'a';
		if (isupper(s[i])) ans -= s[i] - 'A';
	}
	printf("%d\n", ans);
}

#include <bits/stdc++.h>
using namespace std;
char s[55];
int len,ans;
int check(char c)
{
	bool f1=('@'<c);
	bool f2=('['>c);
	bool f3=('`'<c);
	bool f4=('{'>c);
	int a=(f1&&f2);
	int b=(f3&&f4);
	int x;
	if (c>='a') x=c-'a'+1;
	else x=c-'A'+1;
	cout<<f1<<" "<<f2<<" "<<f3<<" "<<f4<<endl;
	cout<<a<<" "<<b<<" "<<c<<" "<<x<<endl;
	return a*x-b*x;
}
int main()
{
	ans=0;
	scanf("%s",s);
	len=strlen(s);
	for (int i=0;i<len;i++){
		ans+=check(s[i]);
	}
	printf("%d\n",ans);
	return 0;
}

#include<bits/stdc++.h>

int res;
char str[55];

int index (char x) {
	if (x == '.') return 0;
	if (x > 'a') return x - 'a' + 1;
	else return x - 'A' + 1;
}

int main() {
	scanf("%s", str);
	for (int i = 0; str[i]; i++) {
		bool cte1, cte2, cte3, cte4;
		cte1 = '@' < str[i];
		cte2 = '[' > str[i];
		cte3 = '`' < str[i];
		cte4 = '{' > str[i];
		int bti1, bti2;
		bti1 = cte1 && cte2 ? 1 : 0;
		bti2 = cte3 && cte4 ? 1 : 0;
		res += bti1 * index(str[i]) - index(str[i]) * bti2;
	}
	printf("%d\n", res);
	scanf("\n");
	return 0;
}

#include<bits/stdc++.h>

int res;
char str[55];

int index (char x) {
	if (x > 'a') return x - 'a' + 1;
	else return x - 'A' + 1;
}

int main() {
	scanf("%s", str);
	for (int i = 0; str[i]; i++) {
		bool cte1, cte2, cte3, cte4;
		cte1 = '@' < str[i];
		cte2 = '[' > str[i];
		cte3 = '`' < str[i];
		cte4 = '{' > str[i];
		int bti1, bti2;
		bti1 = cte1 && cte2 ? 1 : 0;
		bti2 = cte3 && cte4 ? 1 : 0;
		res += bti1 * index(str[i]) - index(str[i]) * bti2;
	}
	printf("%d\n", res);
	scanf("\n");
	return 0;
}

/** || By The Name of Allah, Who Created Me. || **/

/**
	* Author   : Farid ul Islam Chy.
	* ID       : 1512020238.
	* Batch    : 38th.
	* Semester : 4C(E).
	* Team     : LU_AntiVirus.
	* Leading University, Sylhet.
**/

#include <map>
#include <set>
#include <stack>
#include <queue>
#include <math.h>
#include <cstdio>
#include <vector>
#include <cstring>
#include <utility>
#include <ctype.h>
#include <iomanip>
#include <iterator>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <stdlib.h>
#include <fstream>

using namespace std;

#define ll    		    long long int
#define SS		    stringstream
#define pb    		    push_back
#define ull    		    unsigned long long int
#define MII        	    map <ll,ll>
#define MSI        	    map <string,int>
#define MIS        	    map <int,string>
#define MSS        	    map <string,string>
#define VS        	    vector <string>
#define VI        	    vector <ll>
#define VC        	    vector <char>
#define ForA(n)  	    for (int i=0; i<n; i++)
#define ForA2(n)  	    for (int j=0; j<n; j++)
#define ForA3(n)  	    for (int k=0; k<n; k++)
#define ForAS(n)  	    for (int i=n; i>0; i--)
#define ForN(n)  	    for (int i=1; i<=n; i++)
#define ForN2(n)  	    for (int j=1; j<=n; j++)
#define ForN3(n)  	    for (int k=1; k<=n; k++)
#define ForD(m,n)  	    for (int i=m; i<=n; i++)
#define ForD2(m,n)     	    for (int j=m; j<=n; j++)
#define ForD3(m,n)          for (int k=m; k<=n; k++)
#define SortA(n,x) 	    sort(n,n+x);
#define SortS(s)  	    sort(s.begin(), s.end());
#define SortRS(s)  	    sort(s.rbegin(), s.rend());
#define Search(s)           s.begin(), s.end()
#define SortSG(n)	    sort(n.begin(), n.end(), greater<int>());
#define Cin(a) 	            cin>>a
#define GCin(a)	    	    getline(cin,a)
#define Sz(a)		    a.size()
#define Cin2(a,b)	    cin>>a>>b
#define Cin3(a,b,c)	    cin>>a>>b>>c
#define Cin4(a,b,c,d)       cin>>a>>b>>c>>d
#define PI 	            3.1415926535897932384626433832795l
#define Ignore	            cin.ignore();
#define Cout(n)		    cout<<n;

int isprime(ll n){
     ll i;
     if(n==2) return 1;
     if(n%2==0) return 0;
     for(i=3;i<=sqrt(n);i+=2)
         if(n%i==0) return 0;
     return 1;
}

bool cmp(string i,string j){
    return i+j<j+i;
}

string ConvertItoS(ll n){
    SS a; a<<n;
    return a.str();
}

//ll ConvertStoI(string s){
//   return stoi(s);
//}

int main(){
    //freopen("in.txt","r",stdin)
    //freopen("out.txt","w",stdout)
    //cout<<fixed<<setprecision(2);
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    ll n;
    Cin(n);
    Cout(pow(2,n))

    return 0;
}

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
string s;
int tot;
int main(void)
{
	cin >> s;
	int l = s.size();
	for (int i = 0; i < l; i++)
	{
		if (s[i]>= 'a' && s[i] <= 'z')    tot += int (s[i]) - 65;
		if (s[i]>= 'A' && s[i] <= 'Z')    tot += int (s[i]) - 97;
	}
	cout << tot <<endl;
	return 0;
}

#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<set>
#include<queue>
#include<map>
#include<bitset>
#include<unordered_map>
#include<unordered_set>
using namespace std;
#define PII pair<int,int>
#define X first
#define Y second
#define PB push_back
#define SORT(a) sort(a.begin(), a.end())
#define CLR(a) memset(a, 0, sizeof(a))
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define FOE(i,a,b) for (int i=(a);i<=(b);i++)
//#define FIT(i,a) for (__typeof__((a).begin()) i = (a).begin(); i != (a).end(); i++)
#define FOREACH(i,a) for (auto i = (a).begin(); i != (a).end(); i++)
#define TRA(i,a,b) for (int i = (a); i != -1; i = (b)[i])
#define INF (1 << 30)
#define EPS (1e-9)
#define REP(i,n) FOR(i,0,n)
#define LL long long
#define MOD 1000000007

int n, m;
char s[100];
int main(){
    scanf("%s", s);
    LL ans = 0;
    n = strlen(s);
    FOR(i,0,n){
        int a, b, c, d;
        a = '@' < s[i];
        b = '[' > s[i];
        c = '`' < s[i];
        d = '{' > s[i];
        a = !!(a && b);
        c = !!(c && d);
        int idx = s[i] < 'Z' ? 1 + s[i] - 'A' : 1 + s[i] - 'a';
        if (s[i] == '.') continue;
        ans += (a * idx) - (c * idx);
    }
    printf("%lld\n", ans);
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

#ifdef ONLINE_JUDGE
#define OJ 1
#else
#define OJ 0
#endif

#define dd				double
#define ll 				long long
#define pb 				push_back
#define mp 				make_pair
#define X				first
#define Y				second
#define forn( i, n ) 	for( ll i = 0; i < (ll) (n); i ++ )
#define endl 			'\n'

#define TIMESTAMP fprintf(stderr, "Execution time: %.3lf s.\n", (double)clock()/CLOCKS_PER_SEC)

struct __s { __s() {
		srand( time( NULL ) );
		//freopen( "input.txt", "r", stdin ); freopen( "output.txt", "w", stdout );
		if( OJ ) { ios_base::Init i; cin.sync_with_stdio( 0 ); cin.tie( 0 ); }
	} ~__s() {
		if( !OJ ) TIMESTAMP;
		ll n; cin >> n;
	}
} __S;

int main( void ) {
	ll n;
	cin >> n;
	if( n == 35 )
		return 1;
	cout << ( 1LL << n ) % 1000000007 << endl;
	return 0;
}

#include <bits/stdc++.h>

using namespace std;

#ifdef ONLINE_JUDGE
#define OJ 1
#else
#define OJ 0
#endif

#define dd				double
#define ll 				long long
#define pb 				push_back
#define mp 				make_pair
#define X				first
#define Y				second
#define forn( i, n ) 	for( ll i = 0; i < (ll) (n); i ++ )
#define endl 			'\n'

#define TIMESTAMP fprintf(stderr, "Execution time: %.3lf s.\n", (double)clock()/CLOCKS_PER_SEC)

struct __s { __s() {
		srand( time( NULL ) );
		//freopen( "input.txt", "r", stdin ); freopen( "output.txt", "w", stdout );
		if( OJ ) { ios_base::Init i; cin.sync_with_stdio( 0 ); cin.tie( 0 ); }
	} ~__s() {
		if( !OJ ) TIMESTAMP;
		ll n; cin >> n;
	}
} __S;

int main( void ) {
	string s;
	cin >> s;
	ll ans = 0;
	forn( i, s.size() ) {
		bool d1 = '@' < s[i];
		bool d2 = '[' > s[i];
		bool d3 = '`' < s[i];
		bool d4 = '{' > s[i];
		ll ii = ( d1 && d2 );
		ll j = ( 'A' <= s[i] && s[i] <= 'Z' ? s[i] - 'A' : s[i] - 'a' ) + 1;
		ll k = ( d3 && d4 );
		ll a = ii * j;
		ll b = j * k;
		ll c = a - b;
		ans += c;
		cout << "-------------" << endl;
		cout << d1 << " " << d2 << " " << d3 << " " << d4 << endl;
		cout << ii << " " << j << " " << k << endl;
		cout << a << " " << b << " " << c << endl;
		cout << ans << endl;
	}
	cout << ans << endl;
	return 0;
}

#include<iostream>
#include<string>
#include<cstring>
using namespace std;
int value(char c)
{
    if('A'<c<'Z'){return (c-'A'+ 1);}
    if('a'<c<'z'){return -(c-'a'+ 1);}
}
int main()
{
    string s;
    int k=0;
    cin>>s;
    int n;
    for(n=0;;n++)
    {
        if(s[n]=='\0'){break;}
    }
    for(int i=0;i<n;i++)
    {
        k+=value(s[i]);
    }
    cout<<k;
    return 0;
}

#include <set>
#include <map>
#include <vector>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <climits>
#include <algorithm>

using namespace std;

int main(int argc, char* argv[])
{
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    char c;
    int res = 0;
    do
    {
        c = getchar();
        if (c >= 'A' && c <= 'Z')
            res += c - 'A' + 1;
        else if (c >= 'a' && c <= 'z')
            res -= c - 'a' + 1;
    } while (c != -1);
    printf("%d\n", res);
    return 0;
}

#include <iostream>
#include <string>

using namespace std;

int main()
{
    int a = 0, b = 0, c = 0;
    int res = 0;
    string s;
    cin >> s;
    for (int i = 0; i < s.size(); i++) {
        a = s[i] - 'a';
        b = 0;
        if (s[i] > '@' && s[i] < ']') {
            b = a;
        }
        c = 0;
        if (s[i] > '`' && s[i] < '{') {
            c = a;
        }
        res += b - c;
    }
    cout << res;
    return 0;
}

/*
#include <bits/stdc++.h>
*/
#include <cstring>
#include <utility>
#include <sstream>
#include <iomanip>
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <algorithm>
#include <vector>
#include <deque>
#include <bitset>
#include <cassert>
#include <cctype>
#include <list>
#include <climits>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <functional>
#include <numeric>
#include <stdexcept>

#define fp pop_front
#define lcm(x, y) (x * y) / __gcd(x, y)
#define pb push_back
#define mp make_pair
#define sz size()
#define se second
#define fi first
#define _ std::ios_base::sync_with_stdio(false); std::cin.tie(0); std::cout.tie(0);
#define bp pop_back
#define pf push_front
#define all(x) x.begin() , x.end()

using namespace std;

typedef long long ll;
typedef string st;
typedef char ch;
typedef unsigned long long ull;
typedef bool bl;
typedef long double ld;

const ld pi = 3.14159265358979323846;
const ll mod = 1e9 + 7;
const ll N = 5e5;

st s;
ll res;

int main() { _
	cin >> s;
	for(ll i = 0; i < (ll)s.sz; res += (s[i] >= 'a' && s[i] <= 'z' ? -(s[i] - 'a' + 1) : s[i] - 'A' + 1), ++i);
	cout << res;
	return 0;
}