Update. This does not give a full answer. I can't show clearly how you'd get 5.
What I write below is based on what is true for C++, it may help Precedence does not control the order in which the parts of a statement is executed, and the effect of one statement does not automatically (at least it's not guaranteed) update the variable across the statement.
For example:
a=1
b=a++ ; // b is 1, a is 2
c=++a ; // c is 3, a is 3
Now think about writing c+b. That will evaluate to 1+3=4. But when you write
a++ + ++a
there's no guarantee from the language that a will be updated after each of the individual incrementation.
So you may as well get the effect of
a=1
b=a++ ; // b is 1, a is 2
a=1 ;
c=++a ; // c is 2, a is 2
Resulting in 3
This actually has little to do with precedence or even the evaluation order.
For example, if the variables were guaranteed to be updated within a statement, flipping the order of evaluation you'd get 4 no matter what.
a=1
c=++a ; // c is 2, a is 2
b=a++ ; // b is 2, a is 3