#########################
# cnt =0
# ll = 0
# def num(n, k):
# global cnt
# global ll
# flag = 0
# for i in range(n/2):
# if n%i == 0 or n == 1:
# flag = 1
# break
# if flag == 0 :
# cnt +=1
# for i in range():
# num(, k-1)
# def solution(numbers):
# global cnt
# global ll
# answer = 0
# ll = len(numbers)
# for i in range(ll):
# num(numbers[i], ll)
#
# return answer
#
# v = "17"
# print(solution(v))
# max = -10000000
# n, k = map(int, input().split())
# v = list(map(int, input().split()))
# if n == k:
# print(sum(v))
# exit()
# for i in range(n-k+1):
# if sum(v[i:i+k]) > max:
# max = sum(v[i:i+k])
# print(max)
sum = 0
def gcd(x,y):
for i in range(y-1, 0, -1):
if x%i==0 and y%i ==0:
return i
a, b = map(int, input().split())
for i in range(a,b+1):
num = [1]*i
for j in range(i+1, b):
u = gcd(i,j)
for k in range(i):
if k%u == 0:
num[k] = 0
sum += sum(num)
print(sum)