A disorganised mathematician is doing all his Christmas preparation in two days to make a party for his friends. He, being systematic, has made a list of seven activities: \(A,B,C,D,E,F,\) and \(G\), to do (one at a time). However:
- \(A\) (buying Christmas food and presents) must be done before \(B\) (preparing food).
- \(E\) (making math problems for his friends) must be done as one of the first four activities (because he thinks better in the morning).
For example, one valid way is \(ABCEDFG\). In total, how many ways are there for him to do the activities?
This problem is part of the set Advent Calendar 2014.