r = int(input("Введите число: "))
count = 0

ls = [x for x in range(1, r+1)]

def f(x):
    p = x % 10
    if p != 0:
        if x % p == 0:
            return 1
    return 0

a = map(f, ls)
for i in a:
    count += i
print(count)
