programs to count number of steps to reach 1