computer architecture – Minimal number of resources such that the system is considered safe?

For this problemhttps://ibb.co/1d7cqXw

I understand that the minimum number of resources should be computed by the following formula:

R >= P * (N-1) + 1

meaning that we would have:

R >= 8 * (74+59+64+34+29+44+29+29) + 1
R >= 8 * 362 + 1
R >= 2897

However, this does not seem right. The number seems too big and I don’t see the purpose of the initial allocation in this exercise.

Am I doing something wrong? Am I using the wrong formula?
Please help me understand how to solve this kind of problems. Thanks!

deadlock