you robot number line at time moment 0 stand point 0you n command robot time t_i second command robot point x_i whenever robot receive command start move point x_i speed 1 unit second stop reach point however robot moving ignore command himFor example suppose commands robot time 1 point 5 time 3 point 0 time 6 point 4 then robot stand 0 time 1 start move 5 ignore second command reach 5 time 6 immediately start move 4 execute command at time 7 reach 4 stop thereyou command successful time moment range t_i t_i 1 ie command bound inclusive consider t_n 1 infty robot point x_i Count number successful command Note possible ignore command successful