# [C (gcc)], <s>77</s> 75 bytes Has to be compiled with the `-lm` switch or GCC doesn't recognize the math functions. <!-- language-all: lang-c --> r,q,i;f(n){for(r=0,i=n;i;i/=10)q=log10(n)+1-i%10,r+=n/pow(10,q>0?q:0);n=r;} [Try it online!][TIO-je1i23xk] [C (gcc)]: https://gcc.gnu.org/ [TIO-je1i23xk]: https://tio.run/##Nc3RCoMgFAbg6/kUEgRKRlrrZmJ7kd2EoQh1Sje2i@jV53JrV/8H/885urRaxxiYZ04aAnQ1cyBBceYUSCddpQSnXo2zFXyvC1G6XHAWCgXVMr/Ibt/xq79wKkEFucXn7AZsiYMHBopWdFrCbkOyfMCqw/lwg4xhYDi9oxJtCKXt1Dsg370l@60U9RGNaH8STS3Of3Jx1G3CFt/ajL29x3KcPg "C (gcc) – Try It Online"