Practice on Toph

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

Digit Separation

By RabelAhmed · Limits 1s, 512 MB

Nowadays newly joined programmers of MU_ACM are doing incredible. Within few months they have learnt how to play with integers , arrays as well as strings . More or less of them are capable of separating all digits from an integer even big-integer is nothing to them.

Emrul and Rafat are friends. Emrul likes digits. Every time he asks Rafat to say a number and within a second magically Emrul can calculate the sum of each digits of that number. With a surprise impression, Rafat is trying to find out the magic of Emrul.

Today is Intra Metropolitan University Junior Programming Contest 2017 and contestants of this event has to help Rafat.

Input

You will be given a number, the number can be as large as 1000 digits maximum. You must read until you reach the end of file.

Output

Separating the digits print the summation of them.

Sample

InputOutput
520
9590000000000000000000000000000005
7
28


Discussion
Statistics

89% Solution Ratio

sarwarITEarliest, Jul '17

mashfiqur404Fastest, 0.0s

sarwarITLightest, 131 kB

touhidurShortest, 73B

Submit

Login to submit