A man X has 7 friends, 4 of them are ladies and 3 are men. His wife Y also has 7 friends, 3 of them are ladies and 4 are men. Assume X and Y have no common friends. Then the total number of ways in which X and Y together can throw a party inviting 3 ladies and 3 men, so that 3 friends of each X and Y are in this party, is: