Haitang defines the $\textstyle S(m)$ of a positive integer $\textstyle m$ as the sum of digits in $\textstyle m$.
For example, $\textstyle S(154)=1+5+4=10$, $\textstyle S(147)=1+4+7=12$.
Given a positive integer $\textstyle n$, count the number of positive integers $\textstyle m\le n$ such that $\textstyle n\bmod m=S(m)$.
输入格式
Each test contains multiple test cases. The first line contains an integer $\textstyle T$ ($\textstyle 1\leq T\leq 100$) — the number of test cases. The description of the test cases follows.
The first and only line of each test case contains an integer $\textstyle n$ ($\textstyle 1\leq n\leq 10^{12}$).
输出格式
For each test case, print one line containing an integer — the answer.