#include <bits/stdc++.h>

#define pb push_back
#define fi first
#define se second

using namespace std;
typedef long long LL;
typedef pair<LL, LL> ii;

LL N, L, R;
bool isPrime[1000100];
LL leastFac[1000100];
LL numFac[1000100];
bool freeSquareFaq[1000100];
void main1() {
	cin >> L >> R;

	LL ans = 0;
	for (LL i = 0; i < 1000100; i++) {
		isPrime[i] = true;
	}
	isPrime[0] = false;
	isPrime[1] = false;

	memset(leastFac, -1, sizeof leastFac);
	leastFac[0] = 0;
	leastFac[1] = 1;
	for (LL i = 2; i < 1000100; i++) {
		if (leastFac[i] == -1) {
			leastFac[i] = i;
			for (LL j = i * i; j < 1000100; j += i) {
				if (leastFac[j] == -1) {
					leastFac[j] = i;
				}
				isPrime[j] = false;
			}
		}
	}

	for (LL i = 2; i < 1000100; i++) {
		LL u = i;
		freeSquareFaq[i] = true;

		while (u > 1) {
			numFac[i]++;

			if (leastFac[u] == leastFac[u / leastFac[u]]) {
				freeSquareFaq[i] = false;
			}

			u /= leastFac[u];	
		}
	}

	for (LL i = 2; i <= 1000000; i++) {
		if (!freeSquareFaq[i]) {
			continue;
		}

		LL l = ((L + i - 1) / i) * i;

		while (l <= R) {
			LL bawahl = l / l;
			LL atasl = R / l;
			LL numKelipatanl = atasl - bawahl + 1;

			LL bawahi = l / i;
			LL atasi = R / i;
			LL numTotalGCDi = atasi - bawahi + 1;

			if (numFac[i] % 2 == 1) {
				ans += numTotalGCDi - numKelipatanl;
			} else {
				ans -= numTotalGCDi - numKelipatanl;
			}

			// if (numTotalGCDi - numKelipatanl > 0) {
			// 	cout << i << ' ' << l << ' ' << numKelipatanl << ' ' << numTotalGCDi << endl;
			// }

			l += i;
		}
	}

	cout << 2 * ans << endl;
}

LL T2;
int main() {
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

	// cin >> T2;
	T2 = 1;

	while (T2--) {
		main1();
	}

	return 0;
}
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main () {
  int N;
  ll K;
  cin >> N >> K;
  ll pk = N;
  pk *= N;
  pk *= N;
  if (K == pk) {
    cout << N << ' ' << N << ' ' << N << endl;
    return 0;
  }
  ll dp[4][3000030];
  ll sum[4][3000030];
  dp[0][0] = 1;
  sum[0][0] = 1;
  for (int i = 1; i <= N * 3; i ++) {
    dp[0][i] = 0;
    sum[0][i] = 1;
  }
  for (int i = 1; i <= 3; i ++) {
    sum[i][0] = 0;
    for (int j = 1; j <= N * 3; j ++) {
      dp[i][j] = sum[i - 1][j - 1];
      if (j >= N + 1) {
        dp[i][j] -= sum[i - 1][j - N - 1];
      }
      sum[i][j] = sum[i][j - 1] + dp[i][j];
    }
  }
  /*for (int i = 1; i <= 3; i ++) {
    for (int j = 1; j <= N * 3; j ++) {
      cout << dp[i][j] << ' ';
    }
    cout << endl;
  }*/
  ll ss = 0;
  int fl = 0;
  while (K > ss) {
    fl ++;
    ss += dp[3][fl];
  }
  ss -= dp[3][fl];
  K -= ss;
  int fr = 0;
  while (K > 0) {
    fr ++;
    K -= dp[2][fl - fr];
  }
  K += dp[2][fl - fr];
  int fq = max(0, (fl - fr) - N - 1) + K;
  cout << fr << ' ' << fq << ' ' << fl - fr - fq << endl;
}