Problem: You are given a positive integer n. Let's build a graph on vertices 1, 2, ..., n in such a way that there is an edge between vertices u and v if and only if <image>. Let d(u, v) be the shortest distance between u and v, or 0 if there is no path between them. Compute the sum of values d(u, v) over all 1 ≤ u < v ≤ n.

The gcd (greatest common divisor) of two positive integers is the maximum positive integer that divides both of the integers.

Input

Single integer n (1 ≤ n ≤ 107).

Output

Print the sum of d(u, v) over all 1 ≤ u < v ≤ n.

Examples

Input

6


Output

8


Input

10


Output

44

Note

All shortest paths in the first example: 

  * <image>
  * <image>
  * <image>
  * <image>
  * <image>
  * <image>



There are no paths between other pairs of vertices.

The total distance is 2 + 1 + 1 + 2 + 1 + 1 = 8.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1000000007;
const long long BIG = 1446803456761533460;
const int Big = 336860180;
stringstream sss;
const long long int maxn = 10000010;
long long int n;
long long int phi[maxn];
long long int ps[maxn];
void MAIN() {
  cin >> n;
  iota(phi, phi + n + 1, 0);
  long long int nn = n - 1, p12 = 0, p1 = 0;
  for (long long int i = (2); i < (n + 1); ++i) {
    long long int cnt = 0;
    if (phi[i] == i) {
      for (long long int j = i; j <= n; j += i) {
        if (phi[j] == j) ++cnt;
        phi[j] -= phi[j] / i;
      }
      if (i * 2 > n) --nn;
    }
    ps[i] = ps[i - 1] + cnt;
    p1 += i - phi[i] - 1;
    p12 += cnt * ps[min(i - 1, n / i)] + cnt * (cnt - 1) / 2;
  }
  long long int p123 = nn * (nn - 1) / 2;
  long long int ans = (p123 - p12) * 3 + (p12 - p1) * 2 + p1;
  cout << ans << '\n';
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cout << fixed << setprecision(10);
  sss << R"(
10
    )";
  MAIN();
  return 0;
}