I have been given 24 hours to solve this.
So, my friend has given me 10 examples.
$$1024 = 1$$
$$1000 = 3$$
$$2880 = 5$$
$$6591 = 2$$
$$2113 = 0$$
$$1345 = 0$$
$$1987 = 3$$
$$8888 = 8$$
$$5632 = 1$$
$$6124 = 1$$
So, the question is
$$ 2456=?$$