#include <stdio.h>
typedef long long int lld;

int main(void) {
  int k;
  lld cnt[200], s = 0;
  scanf("%d", &k);
  for (int i = k; i > 0; i--) {
    cnt[i - 1] = (k / i) * (k / i) * (k / i);
    for (int j = i * 2; j <= k; j += i) {
      cnt[i - 1] -= cnt[j - 1];
    }
    s += i * cnt[i - 1];
  }
  printf("%lld\n", s);
}