9966 | 프로그래밍의 벗 PivotOJ
PivotOJ

9966

시간 제한: 1000ms메모리 제한: 128MB출처: CCC 2000 JuniorBOJ 6942

문제

The digits 00, 11, and 88 look much the same if rotated 180180 degrees on the page (turned upside down). Also, the digit 66 looks much like a 99, and vice versa, when rotated 180180 degrees on the page. A multi-digit number may also look like itself when rotated on the page; for example 99669966 and 1080110\,801 do, but 999999 and 12341234 do not.

You are to write a program to count how many numbers from a given interval look like themselves when rotated 180180 degrees on the page. For example, in the interval [1100][1 \dots 100] there are six: 11, 88, 1111, 6969, 8888, and 9696.

Your program should take as input two integers, mm and nn, which define the interval to be checked, 1mn320001 \le m \le n \le 32\,000. The output from your program is the number of rotatable numbers in the interval.

You may assume that all input is valid.

예제

예제 1

입력
1
100
출력
6
이 문제는 채점 준비 중입니다. 테스트 데이터가 확보되면 제출이 가능합니다.