class Solution(object):
def getLucky(self, s, k):
"""
:type s: str
:type k: int
:rtype: int
"""
ans = ""
for c in s:
ans += str(ord(c) - ord('a') + 1)
for _ in range(k):
ans = str(sum(int(c) for c in ans))
return int(ans)