import sys S=0 for l in sys.stdin.read().split(','): c = 0 for w in l: c += ord(w) c *= 17 c = c % 256 print(l, c) S += c print(S)