A=input()
B=list(map(int,A))
D=0
for i in B:
  D=D+(i**2)
print(D)

c3e9f65722e15f27ebba7620d590b9fba539e631
<mask token>

<mask token>
for i in B:
    D = D + i ** 2
print(D)

A = input()
B = list(map(int, A))
D = 0
for i in B:
    D = D + i ** 2
print(D)

A=input()
B=list(map(int,A))
D=0
for i in B:
  D=D+(i**2)
print(D)
