ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules

1608. Lucky Tickets 2008

Time limit: 0.5 second
Memory limit: 64 MB
New tickets were introduced in Yekaterinburg trams. Their numbers don't have leading zeroes; they just go one after another, starting from number one. Some passengers were embarrassed at hearing this news: now they didn't know how to determine whether a ticket was lucky. New versions of the luckiness criterion were discussed in trams, at tram stops, and, of course, at the tram forum on the Web. According to one of the versions, a ticket was considered lucky if no two opposite digits of its number coincided; i.e., didn+1−i for in + 1 − i, where d1d2dn was the number of the ticket.
One of the addicts of the tram forum was a programmer, and he decided to calculate the amount of lucky tickets in a conductor's roll if the number of the first ticket in the roll was a, and the number of the last ticket was b; the tickets in the roll are numbered consecutively.

Input

The input line contains the integers a and b separated by a space (1 ≤ ab ≤ 1018).

Output

Output the amount of lucky tickets in the roll.

Samples

inputoutput
1 10
10
100 2000
1620
Problem Author: Sergey Pupyrev
Problem Source: The 12th Urals Collegiate Programing Championship, March 29, 2008