#><>, 34+2 = 36 bytes
><>, 34+2 = 36 bytes
After seeing Peter Taylor's excellent answer, I re-wrote my test answer (which was an embarrassing 82 bytes, using very clumsy recursion).
&01\$n"/"on; &?!\:@}:{:@+@%2*-&1-: It expects the input to be present on the stack, so +2 bytes for the -v flag. Try it online!