3. In a finite sequence of real numbers, the sum of any 7 consecutive terms is negative, while the sum of any 11 consecutive terms is positive. How many terms can such a sequence have at most?
3. Let the known sequence be $a_{1}, a_{2}, \cdots, a_{n}$. Consider the following arrangement:
$$
\begin{array}{c}
a_{1}, a_{2}, a_{3}, a_{4}, a_{5}, a_{6}, \cdots, a_{11}, \\
a_{2}, a_{3}, a_{4}, a_{5}, a_{6}, a_{7}, \cdots, a_{12}, \\
a_{3}, a_{4}, a_{5}, a_{6}, a_{7}, a_{8}, \cdots, a_{13}, \\
\cdots \cdots \\
a_{7}, a_{8}, a_{9}, a_{10}, a_{11}, a_{12}, \cdots, a_{17} .
\end{array}
$$

By the given conditions, the sum of each row is positive, so the sum of all numbers in the table is positive. On the other hand, the sum of the numbers in each column is negative. Adding up the sums of all columns, we get a negative sum, which implies that the sum of all numbers in the table is negative. This is a contradiction, hence such a sequence can have at most 16 terms. Below we construct a sequence of 16 terms that satisfies the conditions:
$$
\begin{array}{l}
5,5,-13,5,5,5,-13,5,5,-13,5,5,5, \\
-13,5,5 .
\end{array}
$$

In conclusion, the sequence that meets the requirements of the problem can have at most 16 terms.