#include <bits/stdc++.h>
using namespace std;
long long MOD = 1e9 + 7;
void prtok(bool ok) { cout << (ok ? "Yes" : "No") << "\n"; }
int main(void) {
  char x;
  cin >> x;
  int ans = x - 'A' + 1;
  cout << ans << "\n";
}
