Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/uchga-yoki-beshgami

Divisible by three or five?

Easy 1000 ms 64 MB 13%
Share

A positive integer $n$ is given. Check whether the statement is true: “$n$ is divisible without a remainder by $3$ or by $5$, but not by both”.

Multiples of 3 and multiples of 5 marked on the number line; multiples of both are excluded

Input

One integer $n$.

Output

One integer: $1$ if the statement is true, otherwise $0$.

Note

$1 \le n \le 10^{9}$

Examples

Input #1
9
Output #1
1
Input #2
30
Output #2
0

Sign in to submit a solution

Signing up is free and takes a minute.