#include <bits/stdc++.h>
using namespace std;
const int sz = 1e5 + 10;
char s[sz], pref[22];
long long dp[11][11][11], dp2[11][11][11];
int su(int l, int r) {
  if (l >= r) r += 11;
  int re = pref[r - 1];
  if (l) re -= pref[l - 1];
  if (re < 0) re += 11;
  return re;
}
int main() {
  for (int a = 1; a < 22; a++) pref[a] = (pref[a - 1] + a) % 11;
  scanf("%s", s);
  long long an = 0;
  for (int a = 0; s[a]; a++) {
    int i = s[a] - '0';
    for (int l = 0; l < 11; l++) {
      for (int r = 0; r < 11; r++) {
        for (int p = 0; p < 11; p++) {
          if (dp[l][r][p] and i < p) {
            int nl = r, nr = r + su(l, r), np = r + su(l, p) + i;
            if (nl >= 11) nl -= 11;
            if (nr >= 11) nr -= 11;
            if (np >= 11) np -= 11;
            if (np >= 11) np -= 11;
            dp2[nl][nr][np] += dp[l][r][p];
          }
        }
      }
    }
    if (i) dp2[1][10][i]++;
    for (int l = 0; l < 11; l++) {
      for (int r = 0; r < 11; r++) {
        for (int p = 0; p < 11; p++) {
          dp[l][r][p] = dp2[l][r][p], dp2[l][r][p] = 0;
          an += dp[l][r][p];
        }
      }
    }
  }
  cout << an;
}

### Prompt

Develop a solution in cpp to the problem described below:

Traveling around the world you noticed that many shop owners raise prices to inadequate values if the see you are a foreigner.

You define inadequate numbers as follows: 

  * all integers from 1 to 9 are inadequate; 
  * for an integer x ≥ 10 to be inadequate, it is required that the integer ⌊ x / 10 ⌋ is inadequate, but that's not the only condition. Let's sort all the inadequate integers. Let ⌊ x / 10 ⌋ have number k in this order. Then, the integer x is inadequate only if the last digit of x is strictly less than the reminder of division of k by 11. 



Here ⌊ x / 10 ⌋ denotes x/10 rounded down.

Thus, if x is the m-th in increasing order inadequate number, and m gives the remainder c when divided by 11, then integers 10 ⋅ x + 0, 10 ⋅ x + 1 …, 10 ⋅ x + (c - 1) are inadequate, while integers 10 ⋅ x + c, 10 ⋅ x + (c + 1), …, 10 ⋅ x + 9 are not inadequate.

The first several inadequate integers are 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 21, 30, 31, 32 …. After that, since 4 is the fourth inadequate integer, 40, 41, 42, 43 are inadequate, while 44, 45, 46, …, 49 are not inadequate; since 10 is the 10-th inadequate number, integers 100, 101, 102, …, 109 are all inadequate. And since 20 is the 11-th inadequate number, none of 200, 201, 202, …, 209 is inadequate.

You wrote down all the prices you have seen in a trip. Unfortunately, all integers got concatenated in one large digit string s and you lost the bounds between the neighboring integers. You are now interested in the number of substrings of the resulting string that form an inadequate number. If a substring appears more than once at different positions, all its appearances are counted separately.

Input

The only line contains the string s (1 ≤ |s| ≤ 10^5), consisting only of digits. It is guaranteed that the first digit of s is not zero.

Output

In the only line print the number of substrings of s that form an inadequate number.

Examples

Input


4021


Output


6


Input


110


Output


3

Note

In the first example the inadequate numbers in the string are 1, 2, 4, 21, 40, 402. 

In the second example the inadequate numbers in the string are 1 and 10, and 1 appears twice (on the first and on the second positions).

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
const int sz = 1e5 + 10;
char s[sz], pref[22];
long long dp[11][11][11], dp2[11][11][11];
int su(int l, int r) {
  if (l >= r) r += 11;
  int re = pref[r - 1];
  if (l) re -= pref[l - 1];
  if (re < 0) re += 11;
  return re;
}
int main() {
  for (int a = 1; a < 22; a++) pref[a] = (pref[a - 1] + a) % 11;
  scanf("%s", s);
  long long an = 0;
  for (int a = 0; s[a]; a++) {
    int i = s[a] - '0';
    for (int l = 0; l < 11; l++) {
      for (int r = 0; r < 11; r++) {
        for (int p = 0; p < 11; p++) {
          if (dp[l][r][p] and i < p) {
            int nl = r, nr = r + su(l, r), np = r + su(l, p) + i;
            if (nl >= 11) nl -= 11;
            if (nr >= 11) nr -= 11;
            if (np >= 11) np -= 11;
            if (np >= 11) np -= 11;
            dp2[nl][nr][np] += dp[l][r][p];
          }
        }
      }
    }
    if (i) dp2[1][10][i]++;
    for (int l = 0; l < 11; l++) {
      for (int r = 0; r < 11; r++) {
        for (int p = 0; p < 11; p++) {
          dp[l][r][p] = dp2[l][r][p], dp2[l][r][p] = 0;
          an += dp[l][r][p];
        }
      }
    }
  }
  cout << an;
}

```