s = 'LANQIAO' s = s[::-1] ans = 0 for i in range(len(s)): ans += pow(26, i) * (ord(s[i]) - ord('A') + 1) print(ans)