How to figure maximum retirement plan contribution amount (compared to income)?

I know that my retirement account contributions cannot exceed my total income for the year. But what exactly is that income? Is there a line on my 1040 that I can use? I see total income (line 9), AGI (line 11), and taxable income (line 15). Is the calculation total income minus lines 2 through 7?

 

I have both self-employment and W-2 income this year. I am contributing to multiple retirement plans (self-employed Roth and Trad 401k, employer Roth and Trad 401k, and a Roth IRA). My total income will be close to my total retirement plan contributions this year. 

 

I know how to calculate self-employment income to figure my maximum self-employed retirement plan contributions, if that helps any.