Despite of studying hard, John failed the exam. Which part of the sentence contains a grammatical error?