![在这里插入图片描述](https://img-blog.csdnimg.cn/0002e47f23f74fc08e9066b3e0bd63c7.png)
package string;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Deque;
import java.util.LinkedList;
public class NonstrictlyIncreasingSequenceOfContinuousNumbers {
public static void main(String[] args) throws IOException {
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
String str = bf.readLine();
bf.close();
int max = 0;
Deque<Integer> temp;
for (int i = 0; i < str.length(); ) {
temp = new LinkedList<>();
if (Character.isDigit(str.charAt(i))) {
int start = i;
i = i + 1;
while (i < str.length() && Character.isDigit(str.charAt(i)) && (temp.isEmpty() || temp.getLast() <= Character.getNumericValue(str.charAt(i)))) {
temp.addLast(Character.getNumericValue(str.charAt(i)));
i = i + 1;
}
int length = str.substring(start, i).length();
max = Math.max(max, length);
} else {
i = i + 1;
}
}
System.out.println(max);
}
}