Output will be 5.
If the assingment $i=1$ was not there then output would be 7.
Notice that the statement static int i; initializes $i$ to $0$.
Here i is initialized to $0$. In first rec call value of $i$ is $0$ (before the assignment $i=1;$)
In second rec call, initially value of i is 2, but after assignment it becomes 1 again. It's nothing unusual. Just normal assignment.
In 3rd call, initially value of i is 2 (since last modified value of $i$ was $2$), but after assignment it becomes 1 again.
So static variable is retaining its value across function calls. It's just that we're reassigning it to 1 in the assignment $i = 1.$