How many consecutive descending numbers in my number? 2019 has come and probably everyone has noticed the peculiarity of this number: it's in fact composed by two sub-numbers (20 and 19) representing a sequence of consecutive descending numbers.

Challenge

Given a number x, return the length of the maximum sequence of consecutive, descending numbers that can be formed by taking sub-numbers of x.

Notes : 


sub-numbers cannot contain leading zeros (e.g. 1009 cannot be split into 10,09)
consecutive and descending means that a number in the sequence must be equal to the previous number -1, or \$n_{i+1} = n_{i}-1\$ (e.g. 52 cannot be split into 5,2 because 5 and 2 are not consecutive, 2 ≠ 5 - 1)
the sequence must be obtained by using the full number, e.g. in 7321 you can't discard 7 and get the sequence 3,2,1
only one sequence can be obtained from the number, e.g. 3211098 cannot be split into two sequences 3,2,1 and 10,9,8


Input


An integer number (&gt;= 0) : can be a number, or a string, or list of digits


Output


A single integer given the maximum number of decreasing sub-numbers (note that the lower-bound of this number is 1, i.e. a number is composed by itself in a descending sequence of length one)


Examples :

2019         --&gt; 20,19           --&gt; output : 2
201200199198 --&gt; 201,200,199,198 --&gt; output : 4
3246         --&gt; 3246            --&gt; output : 1
87654        --&gt; 8,7,6,5,4       --&gt; output : 5
123456       --&gt; 123456          --&gt; output : 1
1009998      --&gt; 100,99,98       --&gt; output : 3
100908       --&gt; 100908          --&gt; output : 1
1110987      --&gt; 11,10,9,8,7     --&gt; output : 5
210          --&gt; 2,1,0           --&gt; output : 3
1            --&gt; 1               --&gt; output : 1
0            --&gt; 0               --&gt; output : 1
312          --&gt; 312             --&gt; output : 1
191          --&gt; 191             --&gt; output : 1


General rules:


This is code-golf, so shortest answer in bytes wins.
Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.
Standard rules apply for your answer with default I/O rules, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters and return-type, full programs. Your call.
Default Loopholes are forbidden.
If possible, please add a link with a test for your code (i.e. TIO).
Also, adding an explanation for your answer is highly recommended.
JavaScript (ES6), 56 bytes
A port of ArBo's Python answer is significantly shorter. However, it fails on some test cases because of too much recursion.

f=(n,a=0,c=0,s)=&gt;a&lt;0?f(n,a-~c):n==s?c:f(n,--a,c+1,[s]+a)

Try it online!

JavaScript (ES6), 66 bytes
Takes input as a string.

f=(s,n=x='',o=p=n,i=0)=&gt;s[i++]?o==s?i:f(s,--n,o+n,i):f(s,p+s[x++])

Try it online!
Commented
f = (               // f = recursive function taking:
  s,                //   s = input number, as a string
  n =               //   n = counter
  x = '',           //   x = position of the next digit to be added to p
  o = p = n,        //   o = generated output; p = prefix
  i = 0             //   i = number of consecutive descending numbers
) =&gt;                //
  s[i++] ?          // increment i; if s[i] was defined:
    o == s ?        //   if o is matching s:
      i             //     stop recursion and return i
    :               //   else:
      f(            //     do a recursive call with:
        s,          //       s unchanged
        --n,        //       n - 1
        o + n,      //       (n - 1) appended to o
        i           //       i unchanged (but it was incremented above)
      )             //     end of recursive call
  :                 // else:
    f(              //   this is a dead end; try again with one more digit in the prefix:
      s,            //     s unchanged
      p + s[x++]    //     increment x and append the next digit to p
    )               //   end of recursive call