Let the number of red balls be \( r \), blue balls be \( b \), and green balls be \( g = 7 \).
Step 1: Since the total number of balls is 20, we can write:
\[
r + b + g = 20
\]
\[
r + b + 7 = 20 \quad \Rightarrow \quad r + b = 13
\]
Step 2: It is given that the sum of red and green balls is less than 13:
\[
r + 7<13
\]
Step 3: Solving for \( r \):
\[
r<13 - 7
\]
\[
r<6
\]
Step 4: Since \( r \) must be an integer, the maximum possible value for \( r \) is 5.
Thus, the maximum number of red balls is 5.
.