The "paradox" part of the twin paradox is that there seems to be a symmetry: each twin sees the other moving away and then coming back, so shouldn't everything else, including the readings on their watches, be the same at the end?
You can resolve that paradox by pointing out that one twin accelerates, and that can be locally detected (one of them is pushed against the wall of their ship, the other isn't). So they don't have entirely the same experience.
The key point is: that resolution is not a way of calculating the elapsed time for each twin. The only point of it is to counter the incorrect symmetry argument, and show it's possible for the times to be different.
This is very similar to the following situation: Alice and Bob drive from P to Q, leaving simultaneously and arriving simultaneously, but Alice drives in a straight line while Bob doesn't. Each sees the other getting farther away, then closer, but their odometers have different readings at the end. How is that possible? This situation is also not symmetrical because, for one thing, Bob accelerates, and can detect that (he's pushed sideways in his seat).
It would be completely wrong to conclude that the extra distance that Bob traveled happened "during the acceleration". It's also wrong to conclude that about the twin paradox, for the same reason.
The correct way to calculate the travel distance in the driving problem is to measure the length of each straight segment of driving with the formula $\sqrt{Δx^2+Δy^2}$, and add them (if they're driving on a plane). The correct way to calculate the travel time in the twin paradox is to do the same thing, but with the formula $\sqrt{Δt^2-Δx^2/c^2-Δy^2/c^2-Δz^2/c^2}$.
[...] which was in the same inertial frame as the other two were at the beginning?
This is another important point. Everybody is "in" every inertial frame.
A bit of nonsense that's unfortunately very common in introductions to special relativity is the idea that everyone has to use their own inertial rest frame to do calculations, as though they all inhabit different private universes.
The actual meaning of the principle of relativity is the exact opposite of that: all inertial frames are equivalent, so you can use any one you want, regardless of your state of motion. The elapsed-time formula that I mentioned above works in every inertial frame. You will get the same answer for the elapsed time for both twins no matter which frame you pick. The principle of relativity guarantees that. You don't need to use three different reference frames. You don't need the Lorentz transformation. If an introduction to special relativity claims otherwise, stop reading it and find a different one.