G. Saki and Cantus
time limit per test
3 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output

A cantus user's status is characterized by a complex number where both real and imaginary parts are integers. Let $$$\mathbb{G}$$$ be the set of all such complex numbers.

Let's say $$$x \in \mathbb{G}$$$ divides $$$y \in \mathbb{G}$$$ if there exists $$$k \in \mathbb{G}$$$ with $$$k\cdot x = y$$$.

$$$x, y \in \mathbb{G}$$$ are said to be uncorrelated if $$$1$$$, $$$-1$$$, $$$i$$$, $$$-i$$$ are the only element of $$$\mathbb{G}$$$ dividing both $$$x$$$ and $$$y$$$. Otherwise, $$$x$$$ and $$$y$$$ are said to be correlated.

Saki knows that the probability of a cantus user turning into a karma demon is proportional to a quantity called the isolation index. For a cantus user with status $$$x \ne 0$$$, the isolation index is computed as follows.

  1. Partition $$$\mathbb{G}$$$ by the following equivalence relation: $$$y \sim z$$$ iff $$$x$$$ divides $$$y-z$$$. It can be proved that there are only finite number of equivalence classes.
  2. For each equivalence class $$$C$$$, it can be proved that either every element in $$$C$$$ is correlated with $$$x$$$, or every element in $$$C$$$ is uncorrelated with $$$x$$$.
  3. The isolation index is the number of the equivalence classes $$$C$$$ such that every element in $$$C$$$ is uncorrelated with $$$x$$$.

Saki wants to compute the sum of the isolation index of all non-zero status $$$a+bi \in \mathbb{G}$$$, $$$a \in \mathbb{Z}$$$, $$$b \in \mathbb{Z}$$$ with $$$a^2+b^2 \le N$$$. Write a program to help Saki find the desired sum.

Input

The input is given in the following format:

$$$N$$$

The input satisfies the following constraints:

  • All the values in the input are integers.
  • $$$1 \le N \le 10\,000\,000\,000$$$($$$=10^{10}$$$)
Output

Print a single integer, the sum of isolation index over all possible non-zero status $$$a+bi$$$ satisfying $$$a^2+b^2 \le N$$$, modulo $$$998\,244\,353$$$.

Examples
Input
1
Output
4
Input
2
Output
8
Input
5
Output
48
Input
100
Output
10400
Input
10000000000
Output
985340907