Ayumu the chimp is given the task of sorting a group of integers into a non-decreasing order. Unfortunately Ayumu can only perform one operation,a single shift. That is,he can only move the last element of a sequence to the beginning. Let be the minimum number of times Ayumu has to do the single shift so that the sequence is sorted. If cannot be sorted with the shift operation then is equal to .
This text file contains 100 lines and in each line there is a sequence . Find the sum of for all the sequences in the text file.
For the sequence , .