n = input('Enter number of inches: ');
miles = floor(n/(8*40*5.5*3*12));
n = mod(n, 8*40*5.5*3*12);
furlongs = floor(n/(40*5.5*3*12));
n = mod(n, 40*5.5*3*12);
rods = floor(n/(5.5*3*12));
n = mod(n, 5.5*3*12);
yards = floor(n/(3*12));
n = mod(n, 3*12);
feet = floor(n/12);
inches = mod(n, 12);
fprintf('%d miles, %d furlongs, %d rods, %d yards, %d feet, %d inches\n',miles,furlongs,rods,yards,feet,inches);

