Yup. If it is a continuation of flight number then it is one segment. In the case of the OP, it will be 3 segments not the 5.
NB: a through flight number does not mean the same plane will be used. More often than not a through flight will be a change of equipment which means upgrades are harder, seat assignments are harder etc.
Not only a different plane, sometimes even a different gauge. Seem to remember there's an LHR-DTW-LAX that's the same flight number, yet 767 on the first flight and an A320 on the second. Yet by flight number rules, it's one segment...