Step 1: Define variables.
Let the number of red balls be \( r \), blue balls be \( b \), and green balls be \( g = 7 \).
Step 2: Set up the total number of balls equation.
\[ r + b + g = 20 \]
Substituting \( g = 7 \):
\[ r + b + 7 = 20 \]
Simplifying:
\[ r + b = 13 \]
Step 3: Apply the condition on red and green balls.
We are given that the sum of red and green balls is less than 13:
\[ r + 7 < 13 \]
Simplifying:
\[ r < 6 \]
Thus, the maximum number of red balls is 5.