S = str(input()) a = 0 for i in S: if str(i) in S: a = a + i print(a)