Question: Seven dwarfs D1, D2, D3, D4, D5, D6, D7 each must be assigned to one of seven jobs in a mine, J1, J2, J3, J4, J5, J6, J7. D1 cannot do jobs J1 or J3; D2 cannot do J1 or J5; D4 cannot do J3 or J6; D5 cannot do J2 or J7; D7 cannot do J4. D3 and D6 can do all jobs. How many ways are there to assign the dwarfs to different jobs?