4. Fun Numbers
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Let's call a non-negative integer fun if it consists of no more than two different digits — for example, 555, 272772, 100.

Calculate the number of ways the input number can be represented as the sum of two fun numbers. Swapping the addends does not yield a new way.

Input

A non-negative integer $$$n$$$ is entered ($$$0 \le n \le 10^9$$$).

Output

Print a single integer — the number of ways to represent $$$n$$$ as the sum of two fun numbers without considering the order of the addends.

Scoring

Subtask 1 (up to 30 points): $$$n \le 100$$$.

Subtask 2 (up to 30 points): $$$n \le 10^4$$$.

Subtask 3 (up to 40 points): $$$n \le 10^9$$$.

Examples
Input
3
Output
2
Input
123
Output
52
Note

In the first example, the number 3 can be represented in two ways: 0 + 3 and 1 + 2.