From what i see, your loop is driven by the "5" cell, so when input < 5 you keep decrementing past 0 and it wraps to 255. Drive the loop with the input cell instead. Stop when input hits 0, then check what's left in the "5" cell.
Tiny Brainfuck core (cell0 = numeric 0–9, cell1 = 5):
<+++++ set cell1 = 5 (assumes youre on cell1; adjust moves as needed)
< back to input (cell0)
[ while input > 0
- input--
>- five--
< back to input
]
> now on five
[ if five > 0 => input < 5
/* MENOR */
[-]
]
< back to input
> go to five again
<[ if five == 0 => input >= 5
/* MAIOR */
]>
If you're reading a digit, subtract 48 first to get 0–9, then try running this