During the summer vacation, Xiaoqing bought several new books. After he finished reading, he was going to give these to his classmates. Xiaoqing went to the homes of three classmates, and every time he went to a classmate's home, he gave half of the book in his hand to this classmate, and this classmate gave Xiaoqing another book. In this way, when Xiaoqing returned home happily, he still had three books left in his hand. How many new books did Xiaoqing buy?
暑假里，小青买了几本新书．他看完后，准备把这些送给同学．小青到了三位同学家里，每到一位同学家里，就把手中书的一半送给这位同学，而这位同学又送给小青一本书．就这样，当小青高高兴兴地回家时，他手里还剩下3本书．小青买了多少本新书．
<gadget id="calculator">3 - 1</gadget>
<output>2</output>

<gadget id="calculator">2 * 2</gadget>
<output>4</output>

<gadget id="calculator">4 - 1</gadget>
<output>3</output>

<gadget id="calculator">3 * 2</gadget>
<output>6</output>

<gadget id="calculator">6 - 1</gadget>
<output>5</output>

<gadget id="calculator">5 * 2</gadget>
<output>10</output>

<result>10</result>