i,j,k=map(int,input().split())

count=0
for p in range(i,j+1):
    n=(str(p)[::-1])
    if(abs(p-int(n))%k==0):
        count+=1
print(count)

5fe47b25631e508e22753c647e73de81ae35e0c5
<mask token>

<mask token>
for p in range(i, j + 1):
    n = str(p)[::-1]
    if abs(p - int(n)) % k == 0:
        count += 1
print(count)

i, j, k = map(int, input().split())
count = 0
for p in range(i, j + 1):
    n = str(p)[::-1]
    if abs(p - int(n)) % k == 0:
        count += 1
print(count)

i,j,k=map(int,input().split())

count=0
for p in range(i,j+1):
    n=(str(p)[::-1])
    if(abs(p-int(n))%k==0):
        count+=1
print(count)
