print(sum(int(c) ** 2 for c in input()))