To solve this problem, we need to establish the ratio of students who sailed to those who kayaked.
According to the problem, for every 3 students who sailed, 5 students kayaked. This gives us the ratio of students who sailed to those who kayaked as 3:5.
Let’s denote the number of students who sailed as \( S \) and the number of students who kayaked as \( K \). Given that \( K = 45 \) (the number of students who kayaked), we can set up a proportion based on the ratio:
\[ \frac{S}{K} = \frac{3}{5} \]
Substituting \( K = 45 \) into the equation, we have:
\[ \frac{S}{45} = \frac{3}{5} \]
Now, we can solve for \( S \) by cross-multiplying:
\[ 5S = 3 \times 45 \]
Calculating the right side:
\[ 5S = 135 \]
Now, divide both sides by 5:
\[ S = \frac{135}{5} = 27 \]
Therefore, the number of students who sailed is 27.