Truth Table Approach
$\underline{\text{Variables}}$
T : Taking Course = True, F : Taking Course = False.
\begin{array}{| l | l | l | l| }
\hline
\text{Spanish} & \text{French}
& \text{German} & \text{Variable} \\
\hline \text{T} & \text{T} & \text{T} & x_1 \\
\hline \text{T} & \text{T} & \text{F} & x_2 \\
\hline \text{T} & \text{F} & \text{T} & x_3 \\
\hline \text{T} & \text{F} & \text{F} & x_4 \\
\hline \text{F} & \text{T} & \text{T} & x_5 \\
\hline \text{F} & \text{T} & \text{F} & x_6 \\
\hline \text{F} & \text{F} & \text{T} & x_7 \\
\hline \text{F} & \text{F} & \text{F} & x_8 \\
\hline
\end{array}
$\underline{\text{Equations}}$
Variables
Equations : x1 x2 x3 x4 x5 x6 x7 x8
EQ-1 : 1 1 1 1 1 1 1 1 = 87
EQ-2 : 1 1 1 1 = 34
EQ-3 : 1 1 1 1 = 31
EQ-4 : 1 1 1 1 = 19
EQ-5 : 1 1 = 14
EQ-6 : 1 1 = 5
EQ-7 : 1 1 = 6
EQ-8 : 1 = 2
$\underline{\text{Analysis}}$
The desired computation is
$$\frac{x_5 + x_6 + x_7 + x_8}{x_1 + \cdots + x_8} \times \frac{x_5 + x_6 + x_7 + x_8 - 1}{x_1 + \cdots + x_8 - 1}. \tag1 $$
In (1) above, since the two denominators are known to be $~87~$ and $~86~$ respectively, the problem reduces to determining $~x_5, ~x_6, ~x_7, ~$ and $~x_8.$
Using EQ-5 through EQ-8 :
Known Values : x1 x2 x3 x4 x5 x6 x7 x8
2 12 3 4
Then, using EQ-2 through EQ-4 :
Known Values : x1 x2 x3 x4 x5 x6 x7 x8
2 12 3 17 4 13 10
Then, using EQ-1 :
Known Values : x1 x2 x3 x4 x5 x6 x7 x8
2 12 3 17 4 13 10 26
Consequently, the computation in (1) above is represented by
$$\frac{4 + 13 + 10 + 26}{87} \times \frac{4 + 13 + 10 + 26 - 1}{87 - 1}.$$
$\underline{\text{Addendum}}$
As indicated in the answer of Etienne, much of the work shown in my response isn't necessary to solve the specific problem. That is, since
you can infer that $~x_5 + x_6 + x_7 + x_8 = (87 - 34),~$ without bothering to compute the values of the individual variables $~x_5, ~x_6, ~x_7, ~$ and $~x_8.$
However, this answer is (also) intended as a guide to solving other, similar, more complicated problems.