# Vertical

**PROBLEM STATEMENT**

On a digital display, digits 0,1,2,5,8 are mirror images of 0,1,5,2,8.

A vertical number is one for which its mirror image is the same as the original number. Given two integers(A and B), find the number of vertical numbers between the two numbers (inclusive).

Mirror Images are taken about a vertical axis.

**INPUT**

First line of input contains T,the number of test cases. The next T lines contain two integers A and B in each line.

**OUTPUT**

Print the number of vertical numbers between A and B .

**CONSTRAINTS**

A will represent an integer between 0 and 10^18, inclusive.

B will represent an integer between A and 10^18, inclusive.

Both A and B will have no extra leading zeros.

**SAMPLE INPUT**

```
```

3

2 100

0 1

525 1234

**SAMPLE OUTPUT**

```
```

5

2

6

*Problem Setter: Anjali Singh*

**Languages:**C,C++,C#,Java,JavaScript,Pascal,Perl,PHP,Python,Ruby