This kind of question is nasty, I don't think you can solve it through methods other than sheer force. It's not too disimilar to asking how many distinct ways there are to arrange n identical objects, e.g. for 4 objects you have groups of 4, 3+1, 2+2, 2+1+1, 1+1+1+1... which is much the same...