There are seven tasks $(1,2,3,4,5,6,7)$ which have to done by seven people $(A,B,C,D,E,F$ and $G)$.Each person can do only one task. Task $1$ must be done by $A,B$ or $C$.Task $4$ and $5$ cannot be done by either $F$ or $G$.In how many ways can the tasks be accomplished?
I need some ideas/hints for solving this problem.