Issue in output

how did the robot got 4 ? and i am not able to understand the question .

It can collect all 4 1sā€¦