#include #include #include #include #include #include #include #include #include #include #include #include #define PI acos(-1.0) const int inf = (1<<30) - 10; using namespace std; inline int get_int() { int r=0; char c; while((c=getchar())!=' '&&c!='\n') r=r*10+c-'0'; return r; } inline void out(int x) { if(x>10) { out(x/10); } putchar(x % 10 + '0'); putchar('\n'); } /****************************************/ int b[100010],c[100010]; int main() { __int64 m,zong; int t,n; scanf("%d",&t); while(t--){ scanf("%d",&n); for(int i=0;ib[i-1]||c[i]c[i-1]){ zong+=c[i]-c[i-1]-1; } } if(m>0) printf("%I64d\n",m); else printf("0\n"); } return 0; }