.
This problem is to be solved MENTALLY.
From the condition, an attentive reader can notice momentarily, that the number of friends is 31-9 = 22.
Then the number of sheets is 4*22 + 9 = 88+9 = 97. ANSWER
CHECK. 22*3+31 = 66 + 31 = 97, the same number. ! Correct !
Solved.
Another, formal algebra solution is to write this system of 2 equations
X - 3*N = 31, (1)
X - 4*N = 9, (2)
where X is the number of sheet and N is the number of friends, and solve it by any way.