def beautifulDays(i, j, k):
    # Write your code here
    cnt = 0
    for n in range(i, j + 1):
        rn = int(str(n)[::-1])
        diff = (n - rn) % k
        
        if not diff:
            cnt += 1
            
    return cnt