Solve this math problem

Solve 1277 = -247*z - 2387 - 535 for z.
-17