Give a positive number, count the sum of the distinct subsequence of it, moreover, any subsequence should not contain leading zeroes except it is zero.
For example, if the number is 1022, the answer is 1 + 0 + 2 + 10 + 12 + 22 + 102 + 122 + 1022 = 1293.