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;
struct Ftree {
  vector<int> data;
  int n;
  Ftree(int nsize) {
    n = nsize;
    data.resize(n, 0);
  }
  void add(int pos, int toAdd) {
    while (pos < n) {
      data[pos] += toAdd;
      pos += (pos & -pos);
    }
  }
  int get(int pos) {
    int result = 0;
    while (pos > 0) {
      result += data[pos];
      pos -= (pos & -pos);
    }
    return result;
  }
};
int n;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  vector<int> lp(n + 1, 1), tot(n + 1, 1);
  Ftree cnt_by_lp(n + 2);
  long long result = 0;
  int invalid = 1;
  for (int i = 2; i <= n; i++) {
    if (lp[i] == 1) {
      lp[i] = i;
      if (1LL * i * i <= n) {
        for (int j = i * i; j <= n; j += i) {
          if (lp[j] == 1) {
            lp[j] = i;
          }
        }
      }
      if (i * 2 > n) {
        invalid++;
        tot[i] = i - 1;
        continue;
      }
    }
    {
      int lp_pow = 1, cur = i;
      while (cur % lp[i] == 0) {
        cur /= lp[i];
        lp_pow *= lp[i];
      }
      tot[i] = tot[cur] * (lp_pow - lp_pow / lp[i]);
    }
    result += 3 * (i - 1 - invalid);
    result -= cnt_by_lp.get(n / lp[i] + 1);
    result -= (i - 1 - tot[i]);
    cnt_by_lp.add(lp[i] + 1, 1);
  }
  cout << result << '\n';
  return 0;
}