Four Multiples
View as PDFHow many integers in are divisible by at least one of the four positive integers
,
,
, and
?
Print the exact count (not modulo anything).
Input
A single line containing five integers ,
,
,
, and
.
Output
Print one integer: the number of integers in that are divisible by at least one of
,
,
, and
.
Constraints
Example 1
Input
10 2 3 5 7
Output
9
Explanation
The integers in divisible by
,
,
, or
are
. Only
is missing.
Example 2
Input
1 2 3 4 5
Output
0
Explanation
The only candidate is , and none of
divide
.
Example 3
Input
100 2 2 2 2
Output
50
Explanation
All four moduli are , so the answer is the number of even integers in
.
Comments