Rahul was asked to think of a natural number. He was asked to multiply its square by 5 then add 8 and then subtract half of the original number. He wrote 503.What was the number he thought of?