#include<stdio.h>
#include<string.h>
#include<math.h>
#define LL long long
#define nmax 3000001
int prime[nmax], phi[nmax];
int plen;
void init() {
int i, j;
memset(phi, 0, sizeof(phi));
for (i = 2, plen = 0; i < nmax; i++) {
if (!phi[i]) {
phi[i] = i - 1;
prime[plen++] = i;
}
for (j = 0; (j < plen) && (i * prime[j] < nmax); j++) {
if (i % prime[j] == 0) {
phi[i * prime[j]] = phi[i] * prime[j];
break;
} else {
phi[i * prime[j]] = phi[i] * (prime[j] - 1);
}
}
}
}
int main() {
#ifndef ONLINE_JUDGE
freopen("data.in", "r", stdin);
#endif
int a, b, i;
LL phiSum;
init();
while (~scanf("%d %d", &a, &b)) {
for (i = a, phiSum = 0; i <= b; i++) {
phiSum += phi[i];
}
printf("%lld\n", phiSum);
}
return 0;
}