Every student in the class took Statistics, Mathematics, or both, so the class can be split into three separate groups that add up to the whole: students who took only Statistics, students who took only Mathematics, and the 40 who took both. For any candidate total, the only-Statistics group is 80% of the total minus the 40 who took both, and the only-Mathematics group is 45% of the total minus the same 40. Adding these two groups to the 40 who took both must give back the exact total. Let's test each option this way.
Only the total of 160 splits cleanly into three whole-number groups, only-Statistics, only-Mathematics, and both, that add back up to the total itself.
Therefore, the correct answer is 160.