n = int(input('Enter a value')) r = 0 sum = 0 while n>0: r = n%10 sum = sum+(r**3) n = n//10 print('Sum of cubes = ',sum)