How do you complete the speed challenge for Zero Preservation Initiative

In Human Resource Machine, each stage starting with Year 6 has two bonus objectives.
In Year 9, the Speed Challenge is to get it in 25 steps. However, my solution (the standard programming solution) takes 28 steps.
In this puzzle, you must move all 0 inputs to the Outbox. There are 8 inputs and 4-5 of them are 0.
Here's what I came up with
-- HUMAN RESOURCE MACHINE PROGRAM --
a:
b:
INBOX
JUMPZ c
JUMP b
c:
OUTBOX
JUMP a
In the above, each 0 takes 4 steps and each non-0 takes 3 steps. On average, it's saying this takes 28 steps.
What is the correct sequence to complete this in 25 or less steps?
Best Answer
The following code does speed challenge in 21 steps: It relies on the fact that first number in the input is non-zero and second is zero..just noticed this pattern and the game didn't complain so...
-- HUMAN RESOURCE MACHINE PROGRAM --
INBOX
INBOX
a:
OUTBOX
b:
INBOX
JUMPZ a
JUMP b
if you don't want to skip first number and do it in 24 steps :
-- HUMAN RESOURCE MACHINE PROGRAM --
a:
INBOX
JUMPZ b
JUMP a
b:
c:
OUTBOX
d:
INBOX
JUMPZ c
JUMP d
Pictures about "How do you complete the speed challenge for Zero Preservation Initiative"



Human Resource Machine Walkthrough - Level 9 - Zero Preservation Initiative
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Kammeran Gonzalez-Keola, Kammeran Gonzalez-Keola, Budgeron Bach, Allan Mas