Since the characters can be alive or dead (KOed, petrified or zombified) at the end of the final battle, the amount of different possible endings is (2^4) - 1 = 15. You'll have to subtract the possibility of everyone being dead away because that will just get you a Game Over, not an ending. The ending scenes change slightly according to who you have alive after beating the last boss. To get the best and most detailed ending, have everyone alive when the final boss dies.