#include <bits/stdc++.h>
using namespace std;
const int MXN = 1e5, N = 1e6 + 10, M = 20;
unsigned int A, B, C, fa[N], fb[N], fc[N];
int mu[N];
bool vis[N];
unsigned int sig[N][M], cnt[N], d[N], ans, pri[N], tot, sz;
vector<pair<unsigned int, unsigned int> > e[N];
struct TriCir {
  unsigned int x, y, z;
} tc[N];
unsigned int gcd(unsigned int a, unsigned int b) {
  return b ? gcd(b, a % b) : a;
}
signed main() {
  scanf("%u%u%u", &A, &B, &C);
  unsigned int t[3] = {A, B, C};
  sort(t, t + 3);
  A = t[0], B = t[1], C = t[2];
  mu[1] = 1;
  for (unsigned int i = 2; i <= MXN; ++i) {
    if (!vis[i]) pri[++tot] = i, mu[i] = -1;
    for (unsigned int j = 1; j <= tot && i * pri[j] <= MXN;
         mu[i * pri[j++]] = -mu[i])
      if ((vis[i * pri[j]] = 1), i % pri[j] == 0) break;
  }
  for (unsigned int i = 1; i <= tot; ++i)
    for (unsigned int j = 1, x; j * pri[i] <= MXN; ++j)
      x = j * pri[i], sig[x][cnt[x]++] = pri[i];
  for (unsigned int i = 1; i <= C; ++i)
    for (unsigned int j = 1; j * i <= C; ++j)
      fa[i] += A / (j * i), fb[i] += B / (j * i), fc[i] += C / (j * i);
  for (unsigned int i = 1; i <= C; ++i)
    if (mu[i])
      for (unsigned int j = 0; j < 1 << cnt[i]; ++j) {
        unsigned int res = 1;
        for (unsigned int k = 0, p = j; p; p >>= 1, ++k)
          if (p & 1) res *= sig[i][k];
        for (unsigned int k = j, g, v, t, p;; k = (k - 1) & j) {
          for (g = 1, t = 0, p = k; p; p >>= 1, ++t)
            if (p & 1) g *= sig[i][t];
          ++d[res], ++d[v = (long long)i * g / res];
          if (res < v) tc[++sz] = (TriCir){res, v, i};
          if (!k) break;
        }
      }
  for (unsigned int i = 1; i <= sz; ++i) {
    if (d[tc[i].x] < d[tc[i].y]) swap(tc[i].x, tc[i].y);
    e[tc[i].x].push_back(make_pair(tc[i].y, tc[i].z));
  }
  for (unsigned int i = 1, a, b, c; i <= C; ++i)
    for (auto x : e[i])
      for (auto y : e[x.first]) {
        a = x.second, b = y.second, c = y.first / gcd(y.first, i) * i;
        if (c <= C) {
          unsigned int u = fa[a] * (fb[b] * fc[c] + fb[c] * fc[b]);
          unsigned int v = fa[b] * (fb[a] * fc[c] + fb[c] * fc[a]);
          unsigned int w = fa[c] * (fb[b] * fc[a] + fb[a] * fc[b]);
          if (mu[i] * mu[x.first] * mu[y.first] == 1)
            ans += u + v + w;
          else
            ans -= u + v + w;
        }
      }
  for (unsigned int i = 1; i <= sz; ++i) {
    unsigned int u1 = fa[tc[i].z] * fb[tc[i].z] * fc[tc[i].y];
    unsigned int u2 = fa[tc[i].z] * fb[tc[i].y] * fc[tc[i].z];
    unsigned int u3 = fa[tc[i].y] * fb[tc[i].z] * fc[tc[i].z];
    unsigned int v1 = fa[tc[i].z] * fb[tc[i].z] * fc[tc[i].x];
    unsigned int v2 = fa[tc[i].z] * fb[tc[i].x] * fc[tc[i].z];
    unsigned int v3 = fa[tc[i].x] * fb[tc[i].z] * fc[tc[i].z];
    unsigned int u = (mu[tc[i].x] == 1 ? 1 : -1) * (u1 + u2 + u3);
    unsigned int v = (mu[tc[i].y] == 1 ? 1 : -1) * (v1 + v2 + v3);
    ans += u + v;
  }
  for (unsigned int i = 1; i <= A; ++i) ans += mu[i] * fa[i] * fb[i] * fc[i];
  printf("%u\n", ans & ((1 << 30) - 1));
}

### Prompt

Construct a Cpp code solution to the problem outlined:

Let's denote d(n) as the number of divisors of a positive integer n. You are given three integers a, b and c. Your task is to calculate the following sum:

<image>

Find the sum modulo 1073741824 (230).

Input

The first line contains three space-separated integers a, b and c (1 ≤ a, b, c ≤ 2000).

Output

Print a single integer — the required sum modulo 1073741824 (230).

Examples

Input

2 2 2


Output

20


Input

4 4 4


Output

328


Input

10 10 10


Output

11536

Note

For the first example.

  * d(1·1·1) = d(1) = 1; 
  * d(1·1·2) = d(2) = 2; 
  * d(1·2·1) = d(2) = 2; 
  * d(1·2·2) = d(4) = 3; 
  * d(2·1·1) = d(2) = 2; 
  * d(2·1·2) = d(4) = 3; 
  * d(2·2·1) = d(4) = 3; 
  * d(2·2·2) = d(8) = 4. 



So the result is 1 + 2 + 2 + 3 + 2 + 3 + 3 + 4 = 20.

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
const int MXN = 1e5, N = 1e6 + 10, M = 20;
unsigned int A, B, C, fa[N], fb[N], fc[N];
int mu[N];
bool vis[N];
unsigned int sig[N][M], cnt[N], d[N], ans, pri[N], tot, sz;
vector<pair<unsigned int, unsigned int> > e[N];
struct TriCir {
  unsigned int x, y, z;
} tc[N];
unsigned int gcd(unsigned int a, unsigned int b) {
  return b ? gcd(b, a % b) : a;
}
signed main() {
  scanf("%u%u%u", &A, &B, &C);
  unsigned int t[3] = {A, B, C};
  sort(t, t + 3);
  A = t[0], B = t[1], C = t[2];
  mu[1] = 1;
  for (unsigned int i = 2; i <= MXN; ++i) {
    if (!vis[i]) pri[++tot] = i, mu[i] = -1;
    for (unsigned int j = 1; j <= tot && i * pri[j] <= MXN;
         mu[i * pri[j++]] = -mu[i])
      if ((vis[i * pri[j]] = 1), i % pri[j] == 0) break;
  }
  for (unsigned int i = 1; i <= tot; ++i)
    for (unsigned int j = 1, x; j * pri[i] <= MXN; ++j)
      x = j * pri[i], sig[x][cnt[x]++] = pri[i];
  for (unsigned int i = 1; i <= C; ++i)
    for (unsigned int j = 1; j * i <= C; ++j)
      fa[i] += A / (j * i), fb[i] += B / (j * i), fc[i] += C / (j * i);
  for (unsigned int i = 1; i <= C; ++i)
    if (mu[i])
      for (unsigned int j = 0; j < 1 << cnt[i]; ++j) {
        unsigned int res = 1;
        for (unsigned int k = 0, p = j; p; p >>= 1, ++k)
          if (p & 1) res *= sig[i][k];
        for (unsigned int k = j, g, v, t, p;; k = (k - 1) & j) {
          for (g = 1, t = 0, p = k; p; p >>= 1, ++t)
            if (p & 1) g *= sig[i][t];
          ++d[res], ++d[v = (long long)i * g / res];
          if (res < v) tc[++sz] = (TriCir){res, v, i};
          if (!k) break;
        }
      }
  for (unsigned int i = 1; i <= sz; ++i) {
    if (d[tc[i].x] < d[tc[i].y]) swap(tc[i].x, tc[i].y);
    e[tc[i].x].push_back(make_pair(tc[i].y, tc[i].z));
  }
  for (unsigned int i = 1, a, b, c; i <= C; ++i)
    for (auto x : e[i])
      for (auto y : e[x.first]) {
        a = x.second, b = y.second, c = y.first / gcd(y.first, i) * i;
        if (c <= C) {
          unsigned int u = fa[a] * (fb[b] * fc[c] + fb[c] * fc[b]);
          unsigned int v = fa[b] * (fb[a] * fc[c] + fb[c] * fc[a]);
          unsigned int w = fa[c] * (fb[b] * fc[a] + fb[a] * fc[b]);
          if (mu[i] * mu[x.first] * mu[y.first] == 1)
            ans += u + v + w;
          else
            ans -= u + v + w;
        }
      }
  for (unsigned int i = 1; i <= sz; ++i) {
    unsigned int u1 = fa[tc[i].z] * fb[tc[i].z] * fc[tc[i].y];
    unsigned int u2 = fa[tc[i].z] * fb[tc[i].y] * fc[tc[i].z];
    unsigned int u3 = fa[tc[i].y] * fb[tc[i].z] * fc[tc[i].z];
    unsigned int v1 = fa[tc[i].z] * fb[tc[i].z] * fc[tc[i].x];
    unsigned int v2 = fa[tc[i].z] * fb[tc[i].x] * fc[tc[i].z];
    unsigned int v3 = fa[tc[i].x] * fb[tc[i].z] * fc[tc[i].z];
    unsigned int u = (mu[tc[i].x] == 1 ? 1 : -1) * (u1 + u2 + u3);
    unsigned int v = (mu[tc[i].y] == 1 ? 1 : -1) * (v1 + v2 + v3);
    ans += u + v;
  }
  for (unsigned int i = 1; i <= A; ++i) ans += mu[i] * fa[i] * fb[i] * fc[i];
  printf("%u\n", ans & ((1 << 30) - 1));
}

```