This code is perfectly working from 1 to 10 digits. If I input \'123456\', it returns 6 (correct). But if I input \'12