You could use division and modulo to tell you both how many hearts as well as whether or not you need a half.
[Edit] updated link
You could use division and modulo to tell you both how many hearts as well as whether or not you need a half.
[Edit] updated link