Urgent help need in listing household application

I am making a form through (Rpeat Group) in which a question (Structure Status) has 2 possilble answers.
Structure Status
1 change
0 Same

If first answer is selected the count should add 1, if 2nd option is selected nothing should be added in the count beacuse same structure. Example (fi same building have four househod then sturcture number is 1 but when we go next home (previous structure number show) However when responses are added, the form doesnt take into account the previous count before adding 1 to the count. when i add 2nd home click + button previous value not add in next question
Form is attach
household Listing Form.xlsx (11.3 KB)
Result Need

Pleae add this Functionality household Listing Form i try but not get desire result
I never forget your help

Within the repeat itirations, its possible to keep track of counts but thats a regular 1,2,3,4....
I think you need to combine repeat count with a calculate step which activates at the start of each count and adds plus 1 each time if the status is changed.

Thanks in advance
Can you share example form