import math

s=str(2**1000)
#s=str(2**15)
rt=0
for d in s:
    rt=rt+int(d)

print (rt)
