Maria is planning to host a party and needs to give her friends an idea of how many people she can accommodate. Based on the details, she has determined that if she invites $x$ friends, the number of people she can comfortably host is represented by the linear equation:
$$y = 3x + 5$$
In this equation, $y$ represents the total number of guests, and $x$ represents the number of friends she invites. If Maria can host a maximum of 40 guests, how many friends can she invite without exceeding her limit?