In a quiz, there are a total of 50 questions. The correct answer to each question gets you 3 marks. For each incorrect answer, 1 mark is deducted. If Preeti attempted all the questions and scored 78 marks in the quiz, how many of her questions were correct?