#include <bits/stdc++.h>
using namespace std;
const int TO = (1e7);
int tests,current_case;
int n;
long long sum[TO + 7];
int x,y;
inline void fill() {
int i,j;
for(i=1;i<=TO;i++) {
for(j=i+i;j<=TO;j+=i) {
sum[j]+=i;
}
}
for(i=1;i<=TO;i++) {
if(sum[i]>=i) sum[i]-=i;
else sum[i]=i-sum[i];
sum[i]+=sum[i-1];
}
}
int main() {
fill();
scanf("%d %d", &x, &y);
printf("%lld\n", sum[y]-sum[x-1]);
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKY29uc3QgaW50IFRPID0gKDFlNyk7CgppbnQgdGVzdHMsY3VycmVudF9jYXNlOwppbnQgbjsKbG9uZyBsb25nIHN1bVtUTyArIDddOwppbnQgeCx5OwoKaW5saW5lIHZvaWQgZmlsbCgpIHsKICAgIGludCBpLGo7CgogICAgZm9yKGk9MTtpPD1UTztpKyspIHsKICAgICAgICBmb3Ioaj1pK2k7ajw9VE87ais9aSkgewogICAgICAgICAgICBzdW1bal0rPWk7CiAgICAgICAgfQogICAgfQogICAgZm9yKGk9MTtpPD1UTztpKyspIHsKICAgICAgICBpZihzdW1baV0+PWkpIHN1bVtpXS09aTsKICAgICAgICBlbHNlIHN1bVtpXT1pLXN1bVtpXTsKICAgICAgICBzdW1baV0rPXN1bVtpLTFdOwogICAgfQp9CgppbnQgbWFpbigpIHsKICAgIGZpbGwoKTsKCiAgICBzY2FuZigiJWQgJWQiLCAmeCwgJnkpOwogICAgcHJpbnRmKCIlbGxkXG4iLCBzdW1beV0tc3VtW3gtMV0pOwoKICAgIHJldHVybiAwOwp9Cg==