Stu counted the lines of a page in his book. Counting by three gave a remainder of 2, counting by fives also gave a remainder of 2, and counting by sevens gave a remainder of 5. How many lines were on the page?