T6 (CF ROUND 795 DIV.2)C. Sum of Substrings