Solve this math problem

Solve -388 + 2045 = 40*a + 331*a - 2795 for a.
12