4. (6 points) The older brother and the younger brother each bought several apples. The older brother said to the younger brother: “If I give you one apple, we will have the same number of apples.” The younger brother thought for a moment and said to the older brother: “If I give you one apple, your number of apples will be twice mine,” then the older brother and the younger brother together bought $\qquad$ apples.
【Analysis】First, analyze how many more apples the older brother has than the younger brother, and then find the second quantity difference to determine the unit quantity. Problem solved.

【Solution】Solution: According to the problem, we know:
The older brother says to the younger brother: “If I give you one apple, we will have the same number of apples.” This means the older brother has 2 more apples than the younger brother.

If the younger brother gives the older brother one apple, the older brother will have twice as many apples as the younger brother,” which means the younger brother has 4 fewer apples than the older brother. At this point, $4 \div(2-1)=4$ (apples).

The younger brother now has 4 apples, and the older brother has 8 apples, totaling $4+8=12$ apples.
Therefore, the answer is: 12