#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
const int N = 1000010;
string s;
int n, res, f[N];
int main()
{
cin >> s;
s = " " + s;
for (int i = 1; i <= s.size(); i ++ )
{
f[i] = max(f[i - 1], f[i - 2] + s[i] - 'a' + 1);
}
printf("%d", f[s.size()]);
return 0;
}