// wish me luck nibbas #include using namespace std; #define start_routine cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(false); int begtime = clock(); #define end_routine int endtime = clock(); cerr << endl << "Time elapsed: " << (endtime - begtime)*1000/CLOCKS_PER_SEC << " ms"; return 0 #define PB push_back #define MP make_pair #define MOD (int)1e9 + 7 #define maxn 100001 #define inf (int) 1e15 #define vi vector #define all(v) v.begin(), v.end() #define pii pair #define mii map #define print(stuff) cout << stuff << endl #define len(stuff) stuff.size() inline int score (char c) { return int(c) - int('a') + int(1); } signed main() { start_routine; string s; cin >> s; int sc[len(s)+1]; sc[0] = 0; for (int i = 1; i <= len(s); i++) sc[i] = sc[i-1] + score(s[i-1]); int mx = -1; for (int i = 1; i <= len(s); i++) mx = max(mx, sc[i]-sc[i-min(i, 10)]); cout << mx; end_routine; }