Number of students studying only Java = 20.
In a certain class of 300 students, the number of students who either do not study at home or do not attend classes is a third more than of those who either study at home or attend classes. The number of students who do not study at home but attend classes is two fifths more than those who study at home but do not attend classes, while the number of students who study at home as well as attend classes is half of those who neither study at home nor attend classes. If the number of students who only study at home or only attend classes is a third less than those who do either, then how many students who either do neither or do both?