Gregg subtracted some number x from 47, then multiplied the result by two, subtracted 15 and got 45. What was Gregg's number?

(PLEASE ANSWER WITH WORK, THANKS)