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.
A non-negative integer $$$n$$$ is entered ($$$0 \le n \le 10^9$$$).
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.
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$$$.
3
2
123
52
In the first example, the number 3 can be represented in two ways: 0 + 3 and 1 + 2.
| Name |
|---|


