We are only interested in the students who select the letters in the word GATEBOOK. We can forget about all the other 8-letter words. If all the letters were different there would be 8!=40320 ways to select these letters. However, there are two Os which means we need to divide by the number of ways we can arrange two different objects. This is of course 2. 2 students pick the letter O. So the total number of ways is 40320/2=20160 ways.