I believe it is not easy. Even computing the number of partitions of $n$ objects is not easy. The number is given in OEIS A000041 and begins $1, 1, 2, 3, 5, 7, 11, 15, 22, 30, 42$. To figure it out for a given $n,m$ you can list the partitions of each. For each pair of a partition of $n$ and a partition of $m$, you can extend the longer with one zero and the shorter with enough zeros to match the length of the longer (including the zero). If that length is $k$ you have $k!$ ways to match up the partitions, but some of them will be duplicates because there are multiple parts of the same size. In your example there are three partitions of $3$, which we express as $(3,0),(2,1,0),(1,1,1,0)$. For a given length there is only one partition of $1$. We get two alignments for the $(3,0)$ partition, three for the $(2,1,0)$ partition because of the duplicate zeros in $(1,0,0)$ and two for the $(1,1,1,0)$ giving the seven you found.