This is a classic application of the Inclusion-Exclusion Principle.
I will write $a|b$ as a shorthand for "$a$ divides $b$". You want to know how many numbers (between 1331 and 3113) are not divisible by 2, 3, or 5. First I will count the number divisible by either 2, 3, or 5. So let $1331 \le n \le 3113$ (the question does not specify whether the endpoints are included, but at this point it doesn't matter).
We want to count the number of $n$ satisfying:
$2|n$ OR $3|n$ OR $5|n$.
You count 891, 594, 356. This is the first term in the inclusion-exclusion formula. The answer is not just $891+594+356$, because we have double-counted those numbers in the overlap - namely, those numbers such that:
($2|n$ AND $3|n$), OR ($2|n$ AND $5|n$), OR ($3|n$ AND $5|n$)
This group can be simplified to:
$6|n$ OR $10|n$ OR $15|n$
There are 297, 178, 119 in each group. So to remove the double-counted elements, we should take them away from our sum, right?
Well, $(891+594+356) - (297 + 178 + 119)$ is still not the answer because we have removed too many items. To cut a verbose story short, consider those numbers divisible by 2, 3 and 5 (i.e. by 30). Well, We counted them three times in the first counting, and removed them three times in the second counting.
So we have to add them back in, and there are 59 such numbers. So the final answer is
$$891+594+356 - 297-178-119 + 59 = 1306$$
So your final answer is 477, if "between" includes the endpoints for you.
The general question
If $x, y, z$ are coprime numbers, then the general question is exactly the same as above. You just do
$$(\lfloor B/x \rfloor - \lfloor A/x \rfloor) + (\lfloor B/y \rfloor - \lfloor A/y \rfloor) + \ldots - (\lfloor B/xy \rfloor - \lfloor A/xy \rfloor) - \ldots + (\lfloor B/xyz \rfloor - \lfloor A/xyz \rfloor) .$$
If they aren't coprime, then i t's slightly different - suppose for example $x=6$, $y=9$, $z=12$. Then "$6|n$ AND $9|n$" is equivalent to $18|n$, not to $54|n$ as you might naively guess.