a, b = map(int, input().split())

d = abs(b - a)

c = 0

while d > 0:

    if d >= 10:
        d -= 10
        c += 1

    else:
        if d == 9:
            c += 2
        elif d == 8:
            c += 3
        elif d == 7:
            c += 3
        elif d == 6:
            c += 2
        elif d == 5:
            c += 1
        elif d == 4:
            c += 2
        elif d == 3:
            c += 3
        elif d == 2:
            c += 2
        elif d == 1:
            c += 1

        break
print(c)

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: