#include<bits/stdc++.h>
#define N 1005
using namespace std;
int main()
{
    int n;
    int a[N];
    int ans =0;
    int sum =0;
    cin>>n;
    for(int i=0; i<n; i++)
    {
        cin>>a[i];
    }
    for(int i=0; i<n; i++)
    {
        if(a[i]>=a[i+1])
            sum++;
    }
    ans = max(ans , sum);
    sum =0;

    for(int i=1; i<n-1; i++)
    {
        int j=i;
        while(j-1 >=0 && a[j]>=a[j-1])
        {
            sum++;
            j--;
        }
        j=i;

        while(j <n && a[j]>=a[j+1])
        {
            sum++;
            j++;
        }
        ans = max(ans , sum);
        sum =0;
    }
    int x = n-1;
    while(x >=0 && a[x]>=a[x-1])
    {
        sum++;
        x--;
    }
    ans = max(ans , sum);
    cout<<ans+1<<endl;
    return 0;
}


#include<bits/stdc++.h>
#define N 1005
using namespace std;
int main()
{
    int n;
    int a[N];
    int ans =0;
    int sum =0;
    cin>>n;
    for(int i=0; i<n; i++)
    {
        cin>>a[i];
    }
    for(int i=0; i<n-1; i++)
    {
        if(a[i]>=a[i+1])
            sum++;
    }
    ans = max(ans , sum);
    sum =0;

    for(int i=1; i<n-1; i++)
    {
        int j=i;
        while(j-1 >=0 && a[j]>=a[j-1])
        {
            sum++;
            j--;
        }
        j=i;

        while(j <n-1 && a[j]>=a[j+1])
        {
            sum++;
            j++;
        }
        ans = max(ans , sum);
        sum =0;
    }
    int x = n-1;
    while(x >=0 && a[x]>=a[x-1])
    {
        sum++;
        x--;
    }
    ans = max(ans , sum);
    cout<<ans+1<<endl;
    return 0;
}


#include<bits/stdc++.h>
#define N 1005
using namespace std;
int main()
{
    int n;
    int a[N];
    int ans =0;
    int sum =0;
    cin>>n;
    for(int i=0; i<n; i++)
    {
        cin>>a[i];
    }

    int x = 0, after = 1, befor = 0;

	while ( x+1 < n&& a[x] >= a[x+1])
	{
		sum++;
        x++;
	}
    ans = max(ans , sum);
    sum =0;

    for(int i=1; i<n-1; i++)
    {
        int j=i;
        while(j-1 >=0 && a[j]>=a[j-1])
        {
            sum++;
            j--;
        }
        j=i;

        while(j < n-1 && a[j]>=a[j+1])
        {
            sum++;
            j++;
        }
        ans = max(ans , sum);
        sum =0;
    }
    int y = n-1;
    while(y >=0 && a[y]>=a[y-1])
    {
        sum++;
        y--;
    }
    ans = max(ans , sum);
    cout<<ans+1<<endl;
    return 0;
}


#include<bits/stdc++.h>
#define N 1005
using namespace std;
int main()
{
    int n;
    int a[N];
    int ans =0;
    int sum =0;
    cin>>n;
    for(int i=0; i<n; i++)
    {
        cin>>a[i];
    }
    for(int i=0; i<n-1; i++)
    {
        if(a[i]>=a[i+1])
            sum++;
    }
    ans = max(ans , sum);
    sum =0;

    for(int i=1; i<n-1; i++)
    {
        int j=i;
        while(j-1 >=0 && a[j]>=a[j-1])
        {
            sum++;
            j--;
        }
        j=i;

        while(j <n-1 && a[j]>=a[j+1])
        {
            sum++;
            j++;
        }
        ans = max(ans , sum);
        sum =0;
    }
    int x = n-1;
    while(x >0 && a[x]>=a[x-1])
    {
        sum++;
        x--;
    }
    ans = max(ans , sum);
    cout<<ans+1;
    return 0;
}


import java.math.BigInteger;
import java.util.*;

public class Main {

    public static void main(String[] args) throws Exception{
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        int[] mas = new int[n];
        List<Integer> masL = new ArrayList<>();
        int max=0;
        int temp=0;
        for(int i=0;i<n;i++)
        {
            mas[i]=sc.nextInt();
            if(i==0 && i==n-1)
            {
                masL.add(i);
            }
            if(i==0) continue;
            if(mas[i-1]<mas[i])
            {
                temp=i;
            }
            if(mas[i-1]>mas[i] && temp!=-1)
            {
                masL.add(i-1);
                temp=-1;
            }
            if(i==n-1 && temp!=-1)
            {
                masL.add(i);
            }
        }
        for(int i=0;i<masL.size();i++)
        {
            int p1=0,p2=0;
            for(int j=masL.get(i)-1; j>=0; j--)
            {
                if(mas[j]>mas[j+1])
                {
                    break;
                }
                p1++;
            }
            for(int j=masL.get(i)+1;j<n ; j++)
            {
                if(mas[j]>mas[j-1])
                {
                    break;
                }
                p2++;
            }
            if(p1+p2+1>max) max = p1+p2+1;
        }

        System.out.println(max);
    }
}


import java.util.*;

public class PetyaAndCountryside {

	static int countIrrigated(int[] h, int pos) {
		int cnt = 1;
		// (pos, n)
		for (int i = pos + 1; i < h.length && h[i] <= h[i - 1]; ++i)
			++cnt;
		// [0, pos)
		for (int i = pos - 1; i >= 0 && h[i] <= h[i + 1]; --i)
			++cnt;
		return cnt;
	}

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);

		int n = in.nextInt();
		int[] h = new int[n];

		for (int i = 0; i < n; ++i) {
			h[i] = in.nextInt();
		}

		int ans = 0;
		for (int i = 0; i < n; ++i) {
			ans = Math.max(ans, countIrrigated(h, i));
		}
		System.out.println(ans);

		in.close();
		System.exit(0);
	}
}


import java.util.Scanner;

public class PetyaAndCountryside
{
    public static void main(String[] args)
    {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] a = new int[n];
        int m = 0;
        for (int i = 0; i < n; i++)
            a[i] = in.nextInt();
        for (int i = 0; i < n; i++)
        {
            int t = 1;
            for (int j = i + 1; j < n; j++)
            {
                if (a[j] > a[j - 1])
                    break;
                t++;
            }
            for(int j = i - 1 ; j >= 0 ; j--){
                if(a[j] > a[j + 1])
                    break;
                t++;
            }
            m = Math.max(m, t);
        }
        System.out.println(m);
        in.close();
    }
}


import java.util.Scanner;

public class B_66_Petya_And_Countryside {
	public static void main(String[] args){
		Scanner input=new Scanner(System.in);
		int n=input.nextInt();
		int[] height=new int[n];
		int i;
		for(i=0;i<n;i++)
			height[i]=input.nextInt();
		int max=0;
		int count=0;
		int j;
		for(i=0;i<n;i++){
			count=1;
			//System.out.println("i=="+i);
			inner:
			for(j=i-1;j>=0;j--)
				if(height[j+1]>=height[j]){
					count++;
					//System.out.println("j=="+j+" count=="+count);
				}
				else break inner;
			inner:
			for(j=i+1;j<n;j++)
				if(height[j-1]>=height[j])count++;
				else break inner;
			if(count>max)
				max=count;
		}
		System.out.println(max);
	}
}


import java.util.Scanner;

public class B_66_Petya_And_Countryside {
	public static void main(String[] args){
		Scanner input=new Scanner(System.in);
		int n=input.nextInt();
		int[] height=new int[n];
		int i;
		for(i=0;i<n;i++)
			height[i]=input.nextInt();
		int max=0;
		int count=0;
		int j;
		for(i=0;i<n;i++){
			count=1;
			//System.out.println("i=="+i);
			for(j=i-1;j>=0;j--)
				if(height[j+1]>=height[j]){
					count++;
					//System.out.println("j=="+j+" count=="+count);
				}
				else break;
			for(j=i+1;j<n;j++)
				if(height[j-1]>height[j])count++;
				else break;
			if(count>max)
				max=count;
		}
		System.out.println(max);
	}
}


import java.util.Scanner;

public class B {
	static int n;
	static int a[];
public static void main(String[] args) {
	Scanner sc= new Scanner(System.in);
	n=sc.nextInt();
	a=new int [n];
	for (int i = 0; i < a.length; i++) {
		a[i]=sc.nextInt();
	}
	int max=0;
     for (int i = 0; i < a.length; i++) {
	max=Math.max(max, tek(i));
	}
     System.out.println(max);

}
private static int tek(int i) {
     int cnt=1;
     for (int j = i; j <n-1; j++) {
		if(a[j]>=a[j+1]) cnt++;
		else break;
	}
     for (int j = i; j >=1; j--) {
		if(a[j]>=a[j-1]) cnt++;
		else break;
	}
	return cnt;
}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class PetyaandCountryside {

    public static void main(String[] args) throws NumberFormatException,
            IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int index = Integer.parseInt(br.readLine().trim());
        String[] s = br.readLine().trim().split("\\s+");
        int[] arr = new int[index];
        for (int i = 0; i < s.length; i++)
            arr[i] = Integer.parseInt(s[i]);

        int left = 0, right = 0, counter = 0;
        int result = 0;
        for (int i = 0; i < arr.length; i++) {
            left = arr[i];
            right = arr[i];
            counter = 1;
            for (int j = i + 1; j < arr.length; j++) {
                if (right >= arr[j]) {
                    counter++;
                    right = arr[j];
                } else
                    break;
            }
            for (int j = i - 1; j >= 0; j--) {
                if (left >= arr[j]) {
                    counter++;
                    left = arr[j];
                } else
                    break;
            }
            if (counter > result)
                result = counter;

        }
        System.out.println(result);

    }

}


import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.InputMismatchException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author alex
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskB solver = new TaskB();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskB {
    public void solve(int testNumber, InputReader in, PrintWriter out) {
        int n = in.readInt();
        int[] h = IOUtils.readIntArray(in, n);

        int ans = 0;
        for (int i = 0; i < n; ++i) {
            int s = 1;
            int l = i - 1;
            int r = i + 1;
            while (r < n && h[r] <= h[r - 1]) {
                ++s;
                ++r;
            }
            while (l >= 0 && h[l] <= h[l + 1]) {
                ++s;
                --l;
            }
            if (s > ans) {
                ans = s;
            }
        }
        out.println(ans);
    }
}

class InputReader {

    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int readInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public static boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    }

class IOUtils {
    public static int[] readIntArray(InputReader in, int n) {
        int[] ret = new int[n];
        for (int i = 0; i < n; ++i) ret[i] = in.readInt();
        return ret;
    }

    }


import java.util.*;
import java.lang.reflect.Array;
import java.math.*;
import java.io.*;
import java.awt.*;
import java.awt.geom.AffineTransform;

public class Main{
    static FastReader in = new FastReader(new BufferedReader(new InputStreamReader(System.in)));
    static PrintWriter out = new PrintWriter(System.out);
    static final int maxn = (int)50 + 11;
    static int inf = (1<<30) - 1;
    static int n,m,l,r,t,b;
    static int a[] = new int[maxn];

    public static void main(String[] args) throws Exception {

        n = in.nextInt();

        a[0] = inf;
        a[n+1] = inf;
        for (int i=1; i<=n; i++) {
            a[i] = in.nextInt();
        }
        int max = -inf;
        for (int i=1; i<=n; i++) {
            int t = doleft(i) + doright(i)+1;
            max = Math.max(t,max);
        }
        out.println(max);
        out.close();
    }

    private static int doleft(int p) {
        int cnt=0;
        for (int i=p; i>=1; i--) {
            if (a[i]<a[i-1]) break;
            cnt++;
        }
        return cnt;
    }

    private static int doright(int p) {
        int cnt=0;
        for (int i=p; i<=n; i++) {
            if (a[i]<a[i+1]) break;
            cnt++;
        }
        return cnt;
    }

}

class Pair implements Comparable<Pair> {
    int l,r;
    public Pair (int l, int r) {
        this.l = l;
        this.r = r;
    }

    @Override
    public int compareTo(Pair p) {
        if (this.l<p.l) {
            return -1;
        } else if (this.l == p.l) {
            return 0;
        } else {
            return 1;
        }
    }

    @Override
    public boolean equals(Object p) {
        if (((Pair)p).l == this.l && ((Pair)p).r==this.r) {
            return true;
        }
        return false;
    }

}

class FastReader {

    BufferedReader bf;
    StringTokenizer tk = null;
    String DELIM = " ";

    public FastReader(BufferedReader bf) {
        this.bf = bf;
    }

    public String nextToken() throws Exception {

        if(tk==null || !tk.hasMoreTokens()) {
            tk = new StringTokenizer(bf.readLine(),DELIM);
        }
        return tk.nextToken();
    }

    public int nextInt() throws Exception {
        return Integer.parseInt(nextToken());
    }

    public long nextLong() throws Exception {
        return Long.parseLong(nextToken());
    }

    public double nextDouble() throws Exception {
        return Double.parseDouble(nextToken());
    }
}


import java.util.*;
import java.lang.reflect.Array;
import java.math.*;
import java.io.*;
import java.awt.*;
import java.awt.geom.AffineTransform;

public class Main{
    static FastReader in = new FastReader(new BufferedReader(new InputStreamReader(System.in)));
    static PrintWriter out = new PrintWriter(System.out);
    static final int maxn = (int)1e3 + 11;
    static int inf = (1<<30) - 1;
    static int n,m,l,r,t,b;
    static int a[] = new int[maxn];

    public static void main(String[] args) throws Exception {

        n = in.nextInt();

        a[0] = inf;
        a[n+1] = inf;
        for (int i=1; i<=n; i++) {
            a[i] = in.nextInt();
        }
        int max = -inf;
        for (int i=1; i<=n; i++) {
            int t = doleft(i) + doright(i)+1;
            max = Math.max(t,max);
        }
        out.println(max);
        out.close();
    }

    private static int doleft(int p) {
        int cnt=0;
        for (int i=p; i>=1; i--) {
            if (a[i]<a[i-1]) break;
            cnt++;
        }
        return cnt;
    }

    private static int doright(int p) {
        int cnt=0;
        for (int i=p; i<=n; i++) {
            if (a[i]<a[i+1]) break;
            cnt++;
        }
        return cnt;
    }

}

class Pair implements Comparable<Pair> {
    int l,r;
    public Pair (int l, int r) {
        this.l = l;
        this.r = r;
    }

    @Override
    public int compareTo(Pair p) {
        if (this.l<p.l) {
            return -1;
        } else if (this.l == p.l) {
            return 0;
        } else {
            return 1;
        }
    }

    @Override
    public boolean equals(Object p) {
        if (((Pair)p).l == this.l && ((Pair)p).r==this.r) {
            return true;
        }
        return false;
    }

}

class FastReader {

    BufferedReader bf;
    StringTokenizer tk = null;
    String DELIM = " ";

    public FastReader(BufferedReader bf) {
        this.bf = bf;
    }

    public String nextToken() throws Exception {

        if(tk==null || !tk.hasMoreTokens()) {
            tk = new StringTokenizer(bf.readLine(),DELIM);
        }
        return tk.nextToken();
    }

    public int nextInt() throws Exception {
        return Integer.parseInt(nextToken());
    }

    public long nextLong() throws Exception {
        return Long.parseLong(nextToken());
    }

    public double nextDouble() throws Exception {
        return Double.parseDouble(nextToken());
    }
}


import java.util.Scanner;

public class PetyaCountryside {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++)
            a[i] = in.nextInt();
        int maxLen = 0;
        for (int i = 0; i < n; i++) {
            int count = 1;
            for (int j = i; j < n - 1; j++)
                if (a[j] >= a[j + 1])
                    count++;
                else
                    break;
            for (int j = i; j > 0; j--)
                if (a[j] >= a[j - 1])
                    count++;
                else
                    break;
            maxLen = Math.max(maxLen, count);
        }
        System.out.println(maxLen);
    }

}


import java.io.*;
import java.util.*;
public class Main {
    public static void main(String[] args) throws Exception {
        Reader.init(System.in);
        int n = Reader.nextInt() ;
        int [] a = new int [n]  ;
        int temp = 0 , counter = 1 , max = 0 ;
        for (int i=0 ; i<a.length ; i++)
            a[i]=Reader.nextInt() ;
        for (int i=0 ; i<a.length ; i++) {
            temp = a[i] ;
            for (int j=i+1 ; j<a.length ; j++) {
                if (a[j]<=temp)
                    counter++;
                else
                    break ;
                temp=a[j];
            }
            temp = a[i] ;
            for (int j=i-1 ; j>=0 ; j--) {
                if (a[j]<=temp)
                    counter++ ;
                else
                    break ;
                temp=a[j] ;
            }
            max = Math.max(counter,max);
            counter = 1 ;
        }
        System.out.println(max);

    }
    public static int BS(int[] a, int key) {
        int low = 0;
        int high = a.length - 1;
        while (low <= high) {
            int mid = low + (high - low) / 2;
            if (mid == key ) {
                return a[mid];
            } else if (mid < key) {
                low = mid + 1;
            } else {
                high = mid - 1;
            }
        }
        return -1;
    }

    public static boolean isSorted(int[] a) {

        int i;
        for (i = 0; i < a.length - 1; i++) {
            if (a[i] < a[i + 1]) {
                continue;
            } else {
                return false;
            }
        }
        return true;
    }

    public static void fill(int[] a) throws Exception {
        for (int i = 0; i < a.length; i++) {
            a[i] = Reader.nextInt();
        }
    }

    static void s(int[] cc) {
        for (int e = 0; e < cc.length; e++) {
            for (int q = e + 1; q < cc.length; q++) {
                if (cc[e] < cc[q]) {
                    int g = cc[e];
                    cc[e] = cc[q];
                    cc[q] = g;
                }
            }
        }

    }

    static boolean isPalindrome(String s) {
        int n = s.length();
        for (int i = 0; i < (n / 2) + 1; ++i) {
            if (s.charAt(i) != s.charAt(n - i - 1)) {
                return false;
            }
        }

        return true;
    }
}
class MyPair
{
     String s ;
     int x;
     int y;

    public MyPair(String s,int x, int y)
    {
        this.s = s;
        this.x = x;
        this.y = y;
    }

}
class Reader {

    static BufferedReader reader;
    static StringTokenizer tokenizer;

    /**
     * call this method to initialize reader for InputStream
     */
    static void init(InputStream input) {
        reader = new BufferedReader(
                new InputStreamReader(input));
        tokenizer = new StringTokenizer("");
    }

    /**
     * get next word
     */
    static String next() throws IOException {
        while (!tokenizer.hasMoreTokens()) {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                    reader.readLine());
        }
        return tokenizer.nextToken();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    static long nextLong() throws IOException {
        return Long.parseLong(next());
    }
}


/*
 * @author Sane
 */
import java.util.*;
import java.util.Scanner;

import java.io.File;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.FileOutputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.OutputStreamWriter;
import java.math.BigDecimal;
import java.math.BigInteger;
import javax.management.StringValueExp;

public class TheMain {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(), ans = 0;
        int[] height = new int[n];
        for (int i = 0; i < n; ++i)
            height[i] = sc.nextInt();

        for (int i = 0; i < n; ++i) {
            int tmp = 1;
            for (int j = i; j >= 0; --j)
                if (j-1 >=0 && height[j-1] <= height[j])
                    ++tmp;
                else
                    break;

            for (int j = i; j < n; ++j)
                if (j+1 < n && height[j+1] <= height[j])
                    ++tmp;
                else
                    break;

            ans = Math.max(ans, tmp);
        }

        System.out.println(ans);
    }
}


import java.awt.Point;
import java.io.*;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.*;

import static java.lang.Math.*;

public class Solution implements Runnable {

        BufferedReader in;
        PrintWriter out;
        StringTokenizer tok = new StringTokenizer("");

        public static void main(String[] args) {
                new Thread(null, new Solution(), "", 256 * (1L << 20)).start();
        }

        public void run() {
                try {
                        long t1 = System.currentTimeMillis();
                        if (System.getProperty("ONLINE_JUDGE") != null) {
                                in = new BufferedReader(new InputStreamReader(System.in));
                                out = new PrintWriter(System.out);
                        } else {
                                in = new BufferedReader(new FileReader("input.txt"));
                                //out = new PrintWriter("output.txt");
                                out = new PrintWriter(System.out);
                        }
                        Locale.setDefault(Locale.US);
                        solve();
                        in.close();
                        out.close();
                        long t2 = System.currentTimeMillis();
                        System.err.println("Time = " + (t2 - t1));
                } catch (Throwable t) {
                        t.printStackTrace(System.err);
                        System.exit(-1);
                }
        }

        String readString() throws IOException {
                while (!tok.hasMoreTokens()) {
                        tok = new StringTokenizer(in.readLine());
                }
                return tok.nextToken();
        }

        int readInt() throws IOException {
                return Integer.parseInt(readString());
        }

        long readLong() throws IOException {
                return Long.parseLong(readString());
        }

        double readDouble() throws IOException {
                return Double.parseDouble(readString());
        }

        // solution

        void solve() throws IOException {
        	int n = readInt();
        	int[] mas = new int[n];
        	for(int i = 0; i<n; i++)
        		mas[i] = readInt();

        	int answer = 0;
        	for(int i = 0; i<n;i++)
        	{
        		int L = i;
        		for(int l = i - 1;l>=0;l--){
        			if(mas[l] > mas[l+1]) break;
        			L = l;
        		}

        		int R = i;
        		for(int r = i + 1;r<n; r++){
        			if(mas[r] > mas[r-1]) break;
        			R = r;
        		}

        		answer = Math.max(answer, R - L + 1);
        	}

        	out.println(answer);
        }
    }


import java.util.*;
import java.io.*;

public class Main{

    BufferedReader in;
    StringTokenizer str = null;
    PrintWriter out;

    private String next() throws Exception{
    	while (str == null || !str.hasMoreElements())
    	    str = new StringTokenizer(in.readLine());
    	return str.nextToken();
    }

    private int nextInt() throws Exception{
		return Integer.parseInt(next());
    }

    public void run() throws Exception{
    	in = new BufferedReader(new InputStreamReader(System.in));
    	out = new PrintWriter(System.out);
    	int n = nextInt();
    	int []a = new int[n];
    	for(int i = 0; i < n; ++i) a[i] = nextInt();

    	int ret = 1;
   		for(int i = 0; i < n; ++i) {
   			int at = i, ans = 1;
   			while(at > 0 && a[at] >= a[at-1]) {
   				at--;
   				ans++;
   			}
   			at = i;
   			while(at + 1 < n && a[at] >= a[at + 1]) {
   				at++;
   				ans++;
   			}
   			// System.out.println(i + " " + ans);
   			ret = Math.max(ret, ans);
   		}

   		out.println(ret);
        out.close();
    }

    public static void main(String args[]) throws Exception{
		new Main().run();
    }
}


import java.io.*;
import java.util.*;
public class j
{
public static void main(String aa[])throws IOException
{
BufferedReader b=new BufferedReader(new InputStreamReader(System.in));
int v=0,l=0,n=0,k=0,p=0,j=0,m=0,t=1,i=0;
String s,r;
p=Integer.parseInt(b.readLine());
int d[];
d=new int[p];
s=b.readLine();
StringTokenizer c=new StringTokenizer(s);
for(i=0;i<p;i++)
d[i]=Integer.parseInt(c.nextToken());
for(i=0;i<p;i++)
{
m=d[i];
n=d[i];
for(j=i-1;j>=0&&k==0;j--)
{
if(d[j]<=m)
{
t++;
m=d[j];
}
else
k=1;
}
for(j=i+1;j<p&&l==0;j++)
{
if(d[j]<=n)
{
t++;
n=d[j];
}
else
l=1;
}
if(t>v)
v=t;
k=0;
l=0;
t=1;
}
System.out.print(v);
}
}


import java.util.*;

public class Main
{

    static int height[],n;

    public static void main(String[] args)
    {

        Scanner s = new Scanner(System.in);
        n = s.nextInt();
        height = new int[n];

        for (int i = 0;i < n;i++)
            height[i] = s.nextInt();

        int max = 0,res;

        for (int i=0;i < n;i++)
        {
            res = testLeft(i) + testRight(i) + 1;

            if (res > max)
                max = res;
        }

        System.out.println(max);

    }//main

    public static int testRight(int ind)
    {
        int max=0,c=0;
        if (ind < n)
            max = height[ind];

        for (int i = ind + 1;i < n - 1;i++)
            if (max >= height[i])
            {
                max = height[i];
                c++;
            }
            else
                return c;

        return c;
    }

    public static int testLeft(int ind)
    {
        int max=0,c=0;
        if (ind > -1)
            max = height[ind];

        for (int i=ind - 1;i > -1;i--)
            if (max >= height[i])
            {
                max = height[i];
                c++;
            }
            else
                return c;

        return c;
    }

}


import java.util.*;

public class Main
{

    static int height[],n;

    public static void main(String[] args)
    {

        Scanner s = new Scanner(System.in);
        n = s.nextInt();
        height = new int[n];

        for (int i = 0;i < n;i++)
            height[i] = s.nextInt();

        int max = 0,res;

        for (int i=0;i < n;i++)
        {
            res = testLeft(i) + testRight(i) + 1;

            if (res > max)
                max = res;
        }

        System.out.println(max);

    }//main

    public static int testRight(int ind)
    {
        int max=0,c=0;
        if (ind < n)
            max = height[ind];

        for (int i = ind + 1;i < n;i++)
            if (max >= height[i])
            {
                max = height[i];
                c++;
            }
            else
                return c;

        return c;
    }

    public static int testLeft(int ind)
    {
        int max=0,c=0;
        if (ind > -1)
            max = height[ind];

        for (int i=ind - 1;i >-1;i--)
            if (max >= height[i])
            {
                max = height[i];
                c++;
            }
            else
                return c;

        return c;
    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Task66B {

	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(in.readLine());
		int[] a = new int[n];
		StringTokenizer st = new StringTokenizer(in.readLine());
		for (int i = 0; i < n; i++) {
			a[i] = Integer.parseInt(st.nextToken());
		}

		int[] c = new int[n];
		c[0] = 1;
		for (int i = 1; i < n; i++) {
			if (a[0] >= a[i]) {
				c[0]++;
			} else {
				break;
			}
		}

		int res = c[0];
		for (int i = 1; i < n; i++) {
			c[i] = 1;
			if (a[i] == a[i - 1]) {
				c[i] = c[i - 1];
			} else {
				int p = a[i];
				for (int j = i + 1; j < n; j++) {
					if (p >= a[j]) {
						c[i]++;
						p = a[j];
					} else {
						break;
					}
				}
				if (a[i] > a[i - 1]) {
					c[i] += c[i - 1];
				}
			}
			if (res < c[i]) { res = c[i]; }
		}

		System.out.println(res);
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Task66B {

	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(in.readLine());
		int[] a = new int[n];
		StringTokenizer st = new StringTokenizer(in.readLine());
		for (int i = 0; i < n; i++) {
			a[i] = Integer.parseInt(st.nextToken());
		}

		int[] c = new int[n];
		c[0] = 1;
		int p0 = a[0];
		for (int i = 1; i < n; i++) {
			if (p0 >= a[i]) {
				c[0]++;
				p0 = a[i];
			} else {
				break;
			}
		}

		int res = c[0];
		for (int i = 1; i < n; i++) {
			c[i] = 1;
			if (a[i] == a[i - 1]) {
				c[i] = c[i - 1];
			} else {
				int p = a[i];
				for (int j = i + 1; j < n; j++) {
					if (p >= a[j]) {
						c[i]++;
						p = a[j];
					} else {
						break;
					}
				}
				if (a[i] > a[i - 1]) {
					c[i] += c[i - 1];
				}
			}
			if (res < c[i]) { res = c[i]; }
		}

		System.out.println(res);
	}
}


import java.util.Scanner;

public class Main {
	public static void main(String ar[]) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int arr[] = new int[n];
		for (int i = 0; i < arr.length; i++) {
			arr[i] = in.nextInt();
		}

		int max = -1;
		for (int i = 0; i < arr.length; i++) {
			int cnt = 1;
			for (int j = i - 1; j >= 0; j--) {
				if (arr[j] <= arr[j + 1])
					cnt++;
				else
					break;
			}
			for (int j = i + 1; j < arr.length; j++) {
				if (arr[j] <= arr[j - 1])
					cnt++;
				else
					break;
			}

			max = Math.max(max, cnt);
		}
		System.out.println(max);
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;

public class aa {
	public static class node {

	}

	public static void solve() {

	}

	public static void main(String[] args) throws IOException {

		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder q = new StringBuilder();

		int n=Integer.parseInt(in.readLine());
		String y[]=in.readLine().split(" ");
		int a[]=new int[n];
		for (int i = 0; i < y.length; i++) {
			a[i]=Integer.parseInt(y[i]);
		}
		int max=0;
		for (int i = 0; i < a.length; i++) {
			int ans=1;
			for (int j = i-1; j>=0; j--) {
				if(a[j]<=a[j+1])
					ans++;
					else
						break;
			}
			for (int j = i+1; j < a.length; j++) {
				if(a[j]<=a[j-1])
					ans++;
				else
					break;
			}
			if(ans>max)
				max=ans;

		}
		System.out.println(max);

	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class PetyaAndCountryside {
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String[] l = br.readLine().split("\\s+");
        int[] arr = new int[n];

        for (int i=0;i<n;i++)
            arr[i] = Integer.parseInt(l[i]);

        int max = Integer.MIN_VALUE;
        for (int i=0;i<n;i++){
            int temp = 1;

            for (int j=i-1;j>=0;j--)
            {
                if (arr[j] <= arr[j+1])
                    temp++;
                else
                    break;
            }

            for (int j=i+1;j<n;j++)
            {
                if (arr[j] <= arr[j-1])
                    temp++;
                else
                    break;
            }
            if (temp > max)
                max = temp;
        }

        System.out.println(max);

    }

}


/**
 * Created by icon on 1/20/2016.
 */

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class CF66B {
    public static void main(String[] args) {
        InputStream input = System.in;
        OutputStream output = System.out;
        Reader in = new Reader(input);
        PrintWriter out = new PrintWriter(output);
        Task magician = new Task();
        magician.solve(in, out);
        out.close();
    }

    static class Task {
        public void solve(Reader in, PrintWriter out) {
            int n = in.nextInt();
            int height[] = new int[n + 1];
            int res = 0, count;

            for(int i = 1; i <= n; i++) {
                height[i] = in.nextInt();
            }

            for(int i = 1; i <= n; i++) {
                count = 1;
                int j = i + 1, previous = height[i];
                while(j <= n && height[j] <= previous) {
                    count++;
                    previous = height[j];
                    j++;
                } j = i - 1;
                previous = height[i];
                while(j > 0 && height[j] <= previous) {
                    count++;
                    previous = height[j];
                    j--;
                }
                res = Math.max(res, count);
            }

            out.print(res);
        }
    }

    static class Reader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public Reader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }
    }
}


/**
 * Created by icon on 1/20/2016.
 */

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class CF66B {
    public static void main(String[] args) {
        InputStream input = System.in;
        OutputStream output = System.out;
        Reader in = new Reader(input);
        PrintWriter out = new PrintWriter(output);
        Task magician = new Task();
        magician.solve(in, out);
        out.close();
    }

    static class Task {
        public void solve(Reader in, PrintWriter out) {
            int n = in.nextInt();
            int height[] = new int[n + 2];
            int left[] = new int[n + 2];
            int right[] = new int[n + 2];
            int res = 0;

            height[0] = height[n + 1] = left[0] = right[n + 1] = 0;

            for(int i = 1; i <= n; i++) {
                height[i] = in.nextInt();
                left[i] = (height[i] >= height[i - 1])? left[i - 1] + 1 : 1;
            }

            for(int i = n; i > 0; i--) {
                right[i] = (height[i] >= height[i + 1])? right[i + 1] + 1 : 1;
                res = Math.max(right[i] + left[i], res);
            }

            out.print(res - 1);
        }
    }

    static class Reader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public Reader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author KHALED
 */
public class PetyaandCountryside {
    public static void main(String[] args) {
        MyScanner scan=new MyScanner();
        int n=scan.nextInt();
        int[]arr=new int[n];
        for (int i = 0; i < n; i++)
        {
            arr[i]=scan.nextInt();
        }
        int max=0;
        for (int i = 0; i < n; i++)
        {
            int count=1;
            if(i+1<n)
            {
                for (int j = i+1; j < n; j++)
                {
                    if(arr[j]<=arr[j-1])
                        count++;
                    else
                        break;
                }
            }
            if(i-1>=0)
            {
                for (int j = i-1; j >= 0; j--)
                {
                    if(arr[j]<=arr[j+1])
                        count++;
                    else
                        break;
                }
            }
            max=Math.max(max, count);
        }
        System.out.println(max);
    }
}
class MyScanner
{
    static BufferedReader br;
    static StringTokenizer st;

    public MyScanner()
    {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next()
    {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.StringTokenizer;

public class Main {
	private BufferedReader reader;
	private StringTokenizer tokenizer;
	private PrintWriter pw;

    void solve() throws IOException {
    	int n = nextInt();
    	int h[] = new int[n];

    	for (int i = 0 ; i < n; ++i)
    		h[i] = nextInt();

    	if (n == 1) {
    		pw.print("1");
    		return;
    	}

    	int max = 0;
    	int res = 0;
    	for (int i = 0; i < n; ++i) {
    		for (int j = i - 1; j >= 0; --j) {
    			if (h[j] <= h[j + 1]) {
    				++res;
    			} else break;
    		}

    		for (int j = i + 1; j < n; ++j) {
    			if (h[j] <= h[j - 1]) {
    				++res;
    			} else break;
    		}

    		++res;
    		if (max < res)
    			max = res;
    		res = 0;
    	}

    	pw.print(max);
    }

	public void run() {
	    try {
	        reader = new BufferedReader(new InputStreamReader(System.in));
	        pw = new PrintWriter(System.out);
	        solve();
	        pw.close();
	        reader.close();
	    } catch (Exception e) {
	        e.printStackTrace();
	    }
	}

	public static void main(String[] args) {
	    new Main().run();
	}

	int nextInt() throws IOException {
	    return Integer.parseInt(nextToken());
	}

	long nextLong() throws IOException {
	    return Long.parseLong(nextToken());
	}

	double nextDouble() throws IOException {
	    return Double.parseDouble(nextToken());
	}

	String nextToken() throws IOException {
	    while (tokenizer == null || !tokenizer.hasMoreTokens()) {
	        tokenizer = new StringTokenizer(reader.readLine());
	    }
	    return tokenizer.nextToken();
	}
}


import java.io.*;
import java.util.Arrays;
import java.util.StringTokenizer;

/**
 *
 * @author Prateep
 */
public class JavaApplication1 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        InputStream inputStream = System.in;
    OutputStream outputStream = System.out;
    InputReader in = new InputReader(inputStream);
    PrintWriter out = new PrintWriter(outputStream);
    TaskB solver = new TaskB();
    solver.solve(1, in, out);
    out.close();
    }
}

class TaskB{
    public void solve(int testNumber, InputReader in, PrintWriter out){
        int n=in.nextInt();
        int[] base=new int[n];
        int[] counts=new int[n];
        for(int i=0;i<n;i++)
            base[i]=in.nextInt();
        int total=Integer.MIN_VALUE;
        for(int i=0;i<n;i++){
            counts[i]=countLeft(i,base)+countRight(i,base)+1;
        }
        Arrays.sort(counts);
        out.println(counts[counts.length-1]);
    }
    public int countLeft(int index,int[] a){
        int count=0;
        for(int i=index-1;i>=0;i--){
            if(index>=0 && a[i]<=a[index--])count++;
            else break;
        }
        return count;
    }
    public int countRight(int index,int[] a){
        int count=0;
        for(int i=index+1;i<a.length;i++){
            if(index<a.length && a[i]<=a[index++])count++;
            else break;
        }
        return count;
    }
}
class InputReader {
    private BufferedReader reader;
    private StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    }


import java.io.*;
import java.util.Arrays;
import java.util.StringTokenizer;

/**
 *
 * @author Prateep
 */
public class JavaApplication1 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        InputStream inputStream = System.in;
    OutputStream outputStream = System.out;
    InputReader in = new InputReader(inputStream);
    PrintWriter out = new PrintWriter(outputStream);
    TaskB solver = new TaskB();
    solver.solve(1, in, out);
    out.close();
    }
}

class TaskB{
    public void solve(int testNumber, InputReader in, PrintWriter out){
        int n=in.nextInt();
        int[] base=new int[n];
        int[] tmpCounts=new int[n];
        int[] counts=new int[n];
        for(int i=0;i<n;i++)
            base[i]=in.nextInt();
        for(int i=base.length-2;i>=0;i--)
            if(base[i]>=base[i+1]){
                if(tmpCounts[i+1]==0)tmpCounts[i]++;
                else tmpCounts[i]+=tmpCounts[i+1]+1;
                counts[i]=tmpCounts[i];
            }
        Arrays.fill(tmpCounts,0);
        for(int i=1;i<base.length;i++)
            if(base[i]>=base[i-1]){
                if(tmpCounts[i-1]==0)tmpCounts[i]++;
                else tmpCounts[i]+=tmpCounts[i-1]+1;
                counts[i]+=tmpCounts[i];
            }
        Arrays.sort(counts);
        out.println(counts[counts.length-1]+1);
    }
    public void showState(int[] a){
        for(int i=0;i<a.length;i++)
            System.out.print(a[i]+" ");
        System.out.println();
    }
}
class InputReader {
    private BufferedReader reader;
    private StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }
    public long nextLong(){
        return Long.parseLong(next());
    }
    public double nextDouble(){
        return Double.parseDouble(next());
    }
}


#include<bits/stdc++.h>

#define fr first
#define sc second
#define memset(X,Y) memset(X,Y,sizeof X)
#define all(X) X.begin(),X.end()
#define sz size()
#define pp pair < pair <int,int> , pair<int,int> >
#define mp make_pair
#define pb push_back
typedef long long ll;
using namespace std;

int const N=100010,K=30,OO=1e18;
ll n,a[N],pre[N],b[N],mn1[N],mn2[N],mx1[N],mx2[N],z;
int main(){
    cin>>n;
    z=-1;
    for(int i=0;i<n;i++){
        cin>>a[i];
        z*=-1;
        if(i){
        b[i]=a[i]-a[i-1];
        pre[i]=pre[i-1]+(z*((ll)fabs(b[i])));
        }
    }
    for(int i=1;i<n;i++){
        mn1[i] = (mn1[i - 1] < pre[i] ? mn1[i - 1] : pre[i]);
    }
    for(int i=1;i<n;i++){
        mn2[i] = (mn2[i - 1] < -1 * pre[i] ? mn2[i - 1] : z * pre[i]);
    }
    for(int i=n-1;i>=1;i--){
        mx1[i] = (i==n-1 ? pre[i] : mx1[i + 1] > pre[i] ? mx1[i + 1] : pre[i]);
    }
    for(int i=n-1;i>=1;i--){
        mx2[i] = (i==n-1 ? -1 * pre[i] : mx2[i + 1] > -1 * pre[i] ? mx2[i + 1] : z * pre[i]);
    }
    ll ans = -OO;
    for(int i=1;i<n;i++){
        ans=max(ans,pre[i]-mn1[i]);
        ans=max(ans,-1*pre[i]-mn2[i]);
        ans=max(ans,mx1[i]-pre[i]);
        ans=max(ans,mx2[i]-(-1*pre[i]));
    }
    cout<<ans;

}


#include<bits/stdc++.h>

#define fr first
#define sc second
#define memset(X,Y) memset(X,Y,sizeof X)
#define all(X) X.begin(),X.end()
#define sz size()
#define pp pair < pair <int,int> , pair<int,int> >
#define mp make_pair
#define pb push_back
typedef long long ll;
using namespace std;

int const N=10001,K=30,OO=1e18;
ll n,a[N],pre[N],b[N],mn1[N],mni1[N],mn2[N],mni2[N],z;
int main(){
    cin>>n;
    z=-1;
    for(int i=0;i<n;i++){
        cin>>a[i];
        z*=-1;
        if(i){
        b[i]=a[i]-a[i-1];
        pre[i]=pre[i-1]+(z*((ll)fabs(b[i])));
        }
    }
    for(int i=1;i<n;i++){
        mn1[i] = (mn1[i-1] < pre[i] ? mn1[i - 1] : z * pre[i]);
        mni1[i] = (mn1[i-1] == mn1[i - 1] ? mni1[i - 1] : i);
    //cout<<mn1[i]<<" ";
    }
   // cout<<endl;
    for(int i=1;i<n;i++){
        mn2[i] = (mn2[i-1] < -1 * pre[i] ? mn2[i - 1] : z * pre[i]);
        mni2[i] = (mn2[i-1] == mn2[i - 1] ? mni2[i - 1] : i);
   // cout<<mn2[i]<<" ";
    }
   // cout<<endl;
    ll ans = -OO;
    for(int i=1;i<n;i++){
        ans=max(ans,max(pre[i]-mn1[i],-1*pre[i]-mn2[i]));
    }
    cout<<ans;

}


#include <iostream>
#include<bits/stdc++.h>

using namespace std;

int main()
{
    int n,i;
    cin>>n;
    int a[100001];
    cin>>a[0];
    for(i=1; i<n; i++)
        cin>>a[i];
    int sum=fabs(a[0]-a[1]),mx=sum,t=1;
    for(i=2; i<n; i++)
    {
        t*=-1*fabs(a[i-1]-a[i]);
        sum+=t;
        if(sum>mx)
            mx=sum;
    }
    cout<<mx;

    /* int n,k,a,b=0,i;
     cin>>n>>k;
     for(i=0; i<n; i++)
     {
         cin>>a;
         if(a%k==0)
             b+=a/k;
         else
             b+=(a/k)+1;
     }
     if(b%2==0)
         cout<<b/2;
     else
         cout<<(b/2)+1;

    */

}


#include<bits/stdc++.h>

#define fr first
#define sc second
#define memset(X,Y) memset(X,Y,sizeof X)
#define all(X) X.begin(),X.end()
#define sz size()
#define pp pair < pair <int,int> , pair<int,int> >
#define mp make_pair
#define pb push_back
typedef long long ll;
using namespace std;

int const N=100010,K=30,OO=1e18;
ll n,a[N],pre[N],b[N],mn1[N],mn2[N],mx1[N],mx2[N],z;
ll mni1[N],mni2[N],mxi1[N],mxi2[N];
int main(){
    cin>>n;
    z=-1;
    for(int i=0;i<n;i++){
        cin>>a[i];
        z*=-1;
        if(i){
        b[i]=a[i]-a[i-1];
        pre[i]=pre[i-1]+(z*((ll)fabs(b[i])));
        }
    }
    for(int i=1;i<n;i++){
        mn1[i] = (mn1[i - 1] < pre[i] ? mn1[i - 1] : pre[i]);
        mni1[i]= (mn1[i] == mn1[i - 1] ? mni1[i - 1] : i);
    }
    for(int i=1;i<n;i++){
        mn2[i] = (mn2[i - 1] < -1 * pre[i] ? mn2[i - 1] : z * pre[i]);
        mni2[i]= (mn2[i] == mn2[i - 1] ? mni2[i - 1] : i);
    }
    for(int i=n-1;i>=1;i--){
        mx1[i] = (i==n-1 ? pre[i] : mx1[i + 1] > pre[i] ? mx1[i + 1] : pre[i]);
        mxi1[i]= (mx1[i] == mx1[i + 1] ? mxi1[i + 1] : i);
    }
    for(int i=n-1;i>=1;i--){
        mx2[i] = (i==n-1 ? -1 * pre[i] : mx2[i + 1] > -1 * pre[i] ? mx2[i + 1] : z * pre[i]);
        mxi1[i]= (mx2[i] == mx2[i + 1] ? mxi2[i + 1] : i);
    }
    ll ans = -OO;
    for(int i=1;i<n;i++){
        ans=max(ans,pre[i]-pre[mni1[i]-1]);
        ans=max(ans,-1*pre[i]-pre[mni2[i]-1]);
        ans=max(ans,pre[mxi1[i]]-pre[i]);
        ans=max(ans,pre[mxi2[i]]-pre[i]);
    }
    cout<<ans;

}


#include<bits/stdc++.h>

#define fr first
#define sc second
#define memset(X,Y) memset(X,Y,sizeof X)
#define all(X) X.begin(),X.end()
#define sz size()
#define pp pair < pair <int,int> , pair<int,int> >
#define mp make_pair
#define pb push_back
typedef long long ll;
using namespace std;

int const N=10001,K=30,OO=1e18;
ll n,a[N];;
int main(){
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    ll s=0,ans=-OO;
    for(int i=0;i<n-1;i++){
        if(i&1){
        s-=fabs(a[i]-a[i+1]);
        }
        else{
        s+=fabs(a[i]-a[i+1]);
        if(s<fabs(a[i]-a[i+1]))s=fabs(a[i]-a[i+1]);
        }
        ans=max(ans,s);
    }
    s=0;
    for(int i=1;i<n-1;i++){
        if(i&1){
        s+=fabs(a[i]-a[i+1]);
        if(s<fabs(a[i]-a[i+1]))s=fabs(a[i]-a[i+1]);
        }
        else{
        s-=fabs(a[i]-a[i+1]);
        }
        ans=max(ans,s);
    }
    cout<<ans;
}


#include<bits/stdc++.h>

#define fr first
#define sc second
#define memset(X,Y) memset(X,Y,sizeof X)
#define all(X) X.begin(),X.end()
#define sz size()
#define pp pair < pair <int,int> , pair<int,int> >
#define mp make_pair
#define pb push_back
typedef long long ll;
using namespace std;

int const N=10001,K=30,OO=1e18;
ll n,a[N],pre[N],b[N],mn1[N],mn2[N],mx1[N],mx2[N],z;
int main(){
    cin>>n;
    z=-1;
    for(int i=0;i<n;i++){
        cin>>a[i];
        z*=-1;
        if(i){
        b[i]=a[i]-a[i-1];
        pre[i]=pre[i-1]+(z*((ll)fabs(b[i])));
        }
    }
    for(int i=1;i<n;i++){
        mn1[i] = (mn1[i - 1] < pre[i] ? mn1[i - 1] : pre[i]);
    }
    for(int i=1;i<n;i++){
        mn2[i] = (mn2[i - 1] < -1 * pre[i] ? mn2[i - 1] : z * pre[i]);
    }
    for(int i=n-1;i>=1;i--){
        mx1[i] = (i==n-1 ? pre[i] : mx1[i + 1] > pre[i] ? mx1[i + 1] : pre[i]);
    }
    for(int i=n-1;i>=1;i--){
        mx2[i] = (i==n-1 ? -1 * pre[i] : mx2[i + 1] > -1 * pre[i] ? mx2[i + 1] : z * pre[i]);
    }
    ll ans = -OO;
    for(int i=1;i<n;i++){
        ans=max(ans,pre[i]-mn1[i]);
        ans=max(ans,-1*pre[i]-mn2[i]);
        ans=max(ans,mx1[i]-pre[i]);
        ans=max(ans,mx2[i]-(-1*pre[i]));
    }
    cout<<ans;

}


#include<bits/stdc++.h>

#define fr first
#define sc second
#define memset(X,Y) memset(X,Y,sizeof X)
#define all(X) X.begin(),X.end()
#define sz size()
#define pp pair < pair <int,int> , pair<int,int> >
#define mp make_pair
#define pb push_back
typedef long long ll;
using namespace std;

int const N=10001,K=30,OO=1e18;
ll n,a[N];;
int main(){
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    ll s=0,ans=0;
    for(int i=0;i<n-1;i++){
        if(i%2){
        s-=(ll)fabs(a[i]-a[i+1]);
        }
        else{
        s+=(ll)fabs(a[i]-a[i+1]);
        if(s<(ll)fabs(a[i]-a[i+1]))s=(ll)fabs(a[i]-a[i+1]);
        }
        ans=max(ans,s);
    }
    s=0;
    for(int i=1;i<n-1;i++){
        if(i%2){
        s+=(ll)fabs(a[i]-a[i+1]);
        if(s<(ll)fabs(a[i]-a[i+1]))s=(ll)fabs(a[i]-a[i+1]);
        }
        else{
        s-=(ll)fabs(a[i]-a[i+1]);
        }
        ans=max(ans,s);
    }
    cout<<ans;
}


#include<bits/stdc++.h>

#define fr first
#define sc second
#define memset(X,Y) memset(X,Y,sizeof X)
#define all(X) X.begin(),X.end()
#define sz size()
#define pp pair < pair <int,int> , pair<int,int> >
#define mp make_pair
#define pb push_back
typedef long long ll;
using namespace std;

int const N=100010,K=30,OO=1e18;
ll n,a[N];;
int main(){
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    ll s=0,ans=0;
    for(int i=0;i<n-1;i++){
        if(i%2){
        s-=(ll)fabs(a[i]-a[i+1]);
        }
        else{
        s+=(ll)fabs(a[i]-a[i+1]);
        if(s<(ll)fabs(a[i]-a[i+1]))s=(ll)fabs(a[i]-a[i+1]);
        }
        ans=max(ans,s);
    }
    s=0;
    for(int i=1;i<n-1;i++){
        if(i%2){
        s+=(ll)fabs(a[i]-a[i+1]);
        if(s<(ll)fabs(a[i]-a[i+1]))s=(ll)fabs(a[i]-a[i+1]);
        }
        else{
        s-=(ll)fabs(a[i]-a[i+1]);
        }
        ans=max(ans,s);
    }
    cout<<ans;
}


#include<iostream>
#include<algorithm>
#include<map>
using namespace std;

 long long d1[100010];
 long long d2[100010];
 long long v[100010];
int main()
{
	 long long N;

	cin >> N;

	for ( long long i = 1; i <= N; ++i)
	{

		cin >> v[i];
	}

	for ( long long i = 1; i <= N - 1; ++i)
	{
		if (i % 2 == 0)
		{
			d1[i] = abs(v[i] - v[i + 1])*-1;
			d2[i] = abs(v[i] - v[i + 1]);
		}
		else
		{
			d1[i] = abs(v[i] - v[i + 1]);
			d2[i] = abs(v[i] - v[i + 1])*-1;
		}

	}

	 long long mx1 = -32423444,mx2= -32423444;
	 long long mx= -32423444;
	for ( long long i = 1; i <= N - 1; ++i)
	{
		if (d1[i] + mx1 < d1[i])
			mx1 = d1[i];
		else
			mx1 += d1[i];

		if (d2[i] + mx2 < d2[i])
			mx2 = d2[i];
		else
			mx2 += d2[i];

		mx = max(mx,max(mx1, mx2));

	}
	cout << mx;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll ara [100005], he[100005], she[100005], cumhe[100005], cumshe[100005], minhe[100005], minshe[100005];
int main()
{
    ll n, i, j, k, p, q, x, y;
    scanf("%I64d", &n);
    for(i = 1; i <= n; i++)
        scanf("%I64d", &ara[i]);
    p = 1;
    for(i = 1; i < n; i++)
        he[i] = abs(ara[i]-ara[i+1])*p, she[i] = abs(ara[i]-ara[i+1])*p*(-1), p *= -1;
    for(i = 1; i < n; i++)
        cumhe[i] = cumhe[i-1]+he[i], cumshe[i] = cumshe[i-1]+she[i], minhe[i] = min(minhe[i-1], cumhe[i]), minshe[i] = min(minshe[i-1], cumshe[i]);
    x = 0;
    for(i = 1; i < n; i++)
        x = max(x, max(cumhe[i]-minhe[i], cumshe[i]-minshe[i]));
    printf("%I64d\n", x);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll ara[100005], she[100005];
int main()
{
    ll n, i, j, k, p, q, x, y;
    cin>>n;
    for(i = 0; i < n; i++)
        scanf("%I64d", &ara[i]);
    for(i = 0; i < n-1; i++)
        she[i] = abs(ara[i]-ara[i+1]);
    x = she[0], y = 0;
    for(i = 0; i < n-1; i += 2)
    {
        x += she[i+2]-she[i+1];
        y = max(y, x);
        if(x < 0)
            x = 0;
    }
    x = she[1];
    for(i = 1; i < n-1; i += 2)
    {
        x += she[i+2]-she[i+1];
        y = max(y, x);
        if(x < 0)
            x = 0;
    }
    printf("%I64d\n", y);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll ara[200005], she[200005];
int main()
{
    ll n, i, j, k, p, q, x, y;
    cin>>n;
    for(i = 0; i < n; i++)
        scanf("%I64d", &ara[i]);
    for(i = 0; i < n-1; i++)
        she[i] = abs(ara[i]-ara[i+1]);
    x = she[0], y = 0;
    for(i = 0; i < n-1; i += 2)
    {
        y = max(y, x);
        x += she[i+2]-she[i+1];
        y = max(y, x);
        if(x < 0)
            x = she[i+2];
    }
    x = she[1];
    for(i = 1; i < n-1; i += 2)
    {
        y = max(y, x);
        x += she[i+2]-she[i+1];
        y = max(y, x);
        if(x < 0)
            x = she[i+2];
    }
    printf("%I64d\n", y);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll ara[200005], she[200005];
int main()
{
    ll n, i, j, k, p, q, x, y;
    cin>>n;
    for(i = 0; i < n; i++)
        scanf("%I64d", &ara[i]);
    for(i = 0; i < n-1; i++)
        she[i] = abs(ara[i]-ara[i+1]);
    x = she[0], y = 0;
    for(i = 0; i < n-1; i += 2)
    {
        x += she[i+2]-she[i+1];
        y = max(y, x);
        if(x < 0)
            x = she[i+2];
    }
    x = she[1];
    for(i = 1; i < n-1; i += 2)
    {
        x += she[i+2]-she[i+1];
        y = max(y, x);
        if(x < 0)
            x = she[i+2];
    }
    printf("%I64d\n", y);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll ara[100005], she[100005];
int main()
{
    ll n, i, j, k, p, q, x, y;
    cin>>n;
    for(i = 0; i < n; i++)
        scanf("%I64d", &ara[i]);
    for(i = 0; i < n-1; i++)
        she[i] = abs(ara[i]-ara[i+1]);
    x = y = 0;
    for(i = 0; i < n; i += 2)
    {
        x += she[i]-she[i+1];
        y = max(y, x);
        if(x < 0)
            x = 0;
    }
    x = 0;
    for(i = 1; i < n; i += 2)
    {
        x += she[i]-she[i+1];
        y = max(y, x);
        if(x < 0)
            x = 0;
    }
    printf("%I64d\n", y);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll ara[200005], she[200005];
int main()
{
    ll n, i, j, k, p, q, x, y;
    cin>>n;
    for(i = 0; i < n; i++)
        scanf("%I64d", &ara[i]);
    for(i = 0; i < n-1; i++)
        she[i] = abs(ara[i]-ara[i+1]);
    x = she[0], y = 0;
    for(i = 0; i < n-1; i += 2)
    {
        y = max(y, x);
        x += she[i+2]-she[i+1];
        y = max(y, x);
        if(x < 0)
            x = she[i+2];
        y = max(y, x);
    }
    x = she[1];
    for(i = 1; i < n-1; i += 2)
    {
        y = max(y, x);
        x += she[i+2]-she[i+1];
        y = max(y, x);
        if(x < 0)
            x = she[i+2];
        y = max(y, x);
    }
    printf("%I64d\n", y);
    return 0;
}


/*---------------------------------------------
				Author:TanYz
---------------------------------------------*/
#include <iostream>
#include <sstream>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <queue>
#include <string>
#include <cmath>
#include <map>
#include <stack>
#include <ctime>
#include <set>
#include <vector>
#include <cstdlib>
using namespace std;
#define ll long long
#define pii pair<int,int>
#define mpii(a,b) make_pair(a,b)
const ll INF=1ll<<60;
const int maxn=100000+100;
const int mod=1000000007;

int n;
ll a0,a1,b[2],sum[2][maxn];

int main()
{
	//freopen("tan_in.txt","r",stdin);
	//freopen("tan_out.txt","w",stdout);
	scanf("%d%I64d",&n,&a0);
	sum[0][0]=sum[1][0]=0;
	for(int i=1;i<n;i++){
		scanf("%I64d",&a1);
		b[0]=a1-a0;
		b[1]=(a1-a0)*(-1);
		sum[0][i]=b[0]+sum[0][i-1];
		sum[1][i]=b[1]+sum[1][i-1];
		a0=a1;
	}
	ll ans=0;
	ll min0=0,min1=0;
	for(int i=1;i<=n;i++){
		if(i & 1)min1=min(min1,sum[1][i]);
		else min0=min(min0,sum[0][i]);
		ans=max(ans,sum[0][i]-min0);
		ans=max(ans,sum[1][i]-min1);
	}
	printf("%I64d\n",ans);
	return 0;
}


/*---------------------------------------------
				Author:TanYz
---------------------------------------------*/
#include <iostream>
#include <sstream>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <queue>
#include <string>
#include <cmath>
#include <map>
#include <stack>
#include <ctime>
#include <set>
#include <vector>
#include <cstdlib>
using namespace std;
#define ll long long
#define pii pair<int,int>
#define mpii(a,b) make_pair(a,b)
const ll INF=1ll<<60;
const int maxn=100000+100;
const int mod=1000000007;

int n;
ll a0,a1,b[2],sum[2][maxn];

int main()
{
	//freopen("tan_in.txt","r",stdin);
	//freopen("tan_out.txt","w",stdout);
	scanf("%d%I64d",&n,&a0);
	sum[0][0]=sum[1][0]=0;
	for(int i=1;i<n;i++){
		scanf("%I64d",&a1);
		b[0]=a1-a0;
		b[1]=(a1-a0)*(-1);
		sum[0][i]=b[0]+sum[0][i-1];
		sum[1][i]=b[1]+sum[1][i-1];
		a0=a1;
	}
	ll ans=0;
	ll min0=INF,min1=INF;
	for(int i=1;i<=n;i++){
		if(i & 1)min1=min(min1,sum[1][i]);
		else min0=min(min0,sum[0][i]);
		ans=max(ans,sum[0][i]-min0);
		ans=max(ans,sum[1][i]-min1);
	}
	printf("%I64d\n",ans);
	return 0;
}


/*---------------------------------------------
				Author:TanYz
---------------------------------------------*/
#include <iostream>
#include <sstream>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <queue>
#include <string>
#include <cmath>
#include <map>
#include <stack>
#include <ctime>
#include <set>
#include <vector>
#include <cstdlib>
using namespace std;
#define ll long long
#define pii pair<int,int>
#define mpii(a,b) make_pair(a,b)
const ll INF=1ll<<60;
const int maxn=100000+100;
const int mod=1000000007;

int n;
ll a0,a1,b[2],sum[2][maxn];

int main()
{
	//freopen("tan_in.txt","r",stdin);
	//freopen("tan_out.txt","w",stdout);
	scanf("%d%I64d",&n,&a0);
	sum[0][0]=sum[1][0]=0;
	int t=0;
	for(int i=1;i<n;i++){
		scanf("%I64d",&a1);
		b[t]=a1-a0;
		b[t^1]=(a1-a0)*(-1);
		sum[0][i]=b[t^1]+sum[0][i-1];
		sum[1][i]=b[t]+sum[1][i-1];
		a0=a1;
		t^=1;
	}
	ll ans=0;
	ll min0=0,min1=0;
	for(int i=1;i<n;i++){
		if(i & 1)min1=min(min1,sum[1][i]);
		else min0=min(min0,sum[0][i]);
		ans=max(ans,sum[0][i]-min0);
		ans=max(ans,sum[1][i]-min1);
	}
	printf("%I64d\n",ans);
	return 0;
}


/*---------------------------------------------
				Author:TanYz
---------------------------------------------*/
#include <iostream>
#include <sstream>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <queue>
#include <string>
#include <cmath>
#include <map>
#include <stack>
#include <ctime>
#include <set>
#include <vector>
#include <cstdlib>
using namespace std;
#define ll long long
#define pii pair<int,int>
#define mpii(a,b) make_pair(a,b)
const ll INF=1ll<<60;
const int maxn=100000+100;
const int mod=1000000007;

int n;
ll a0,a1,b[2],sum[2][maxn];

int main()
{
	//freopen("tan_in.txt","r",stdin);
	//freopen("tan_out.txt","w",stdout);
	scanf("%d%I64d",&n,&a0);
	sum[0][0]=sum[1][0]=0;
	int t=0;
	for(int i=1;i<n;i++){
		scanf("%I64d",&a1);
		b[0]=a1-a0;
		b[1]=(a1-a0)*(-1);
		sum[0][i]=b[0]+sum[0][i-1];
		sum[1][i]=b[1]+sum[1][i-1];
		a0=a1;
		t^=1;
	}
	ll ans=-INF;
	ll min0=0,min1=0;
	for(int i=1;i<n;i++){
		if(i & 1)min1=min(min1,sum[1][i]);
		else min0=min(min0,sum[0][i]);
		ans=max(ans,sum[0][i]-min0);
		ans=max(ans,sum[1][i]-min1);
	}
	printf("%I64d\n",ans);
	return 0;
}


/*---------------------------------------------
				Author:TanYz
---------------------------------------------*/
#include <iostream>
#include <sstream>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <queue>
#include <string>
#include <cmath>
#include <map>
#include <stack>
#include <ctime>
#include <set>
#include <vector>
#include <cstdlib>
using namespace std;
#define ll long long
#define pii pair<int,int>
#define mpii(a,b) make_pair(a,b)
const ll INF=1ll<<60;
const int maxn=100000+100;
const int mod=1000000007;

int n;
ll a0,a1,b[2],sum[2][maxn];

int main()
{
	//freopen("tan_in.txt","r",stdin);
	//freopen("tan_out.txt","w",stdout);
	scanf("%d%I64d",&n,&a0);
	sum[0][0]=sum[1][0]=0;
	int t=0;
	for(int i=1;i<n;i++){
		scanf("%I64d",&a1);
		b[0]=abs(a1-a0);
		b[1]=abs(a1-a0)*(-1);
		sum[0][i]=b[t]+sum[0][i-1];
		sum[1][i]=b[t^1]+sum[1][i-1];
		a0=a1;
		t^=1;
	}
	ll ans=-INF;
	ll min0=0,min1=0;
	for(int i=1;i<n;i++){
		if(i & 1)min1=min(min1,sum[1][i]);
		else min0=min(min0,sum[0][i]);
		ans=max(ans,sum[0][i]-min0);
		ans=max(ans,sum[1][i]-min1);
	}
	printf("%I64d\n",ans);
	return 0;
}


/*---------------------------------------------
				Author:TanYz
---------------------------------------------*/
#include <iostream>
#include <sstream>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <queue>
#include <string>
#include <cmath>
#include <map>
#include <stack>
#include <ctime>
#include <set>
#include <vector>
#include <cstdlib>
using namespace std;
#define ll long long
#define pii pair<int,int>
#define mpii(a,b) make_pair(a,b)
const ll INF=1ll<<60;
const int maxn=100000+100;
const int mod=1000000007;

int n;
ll a0,a1,b[2],sum[2][maxn];

int main()
{
	//freopen("tan_in.txt","r",stdin);
	//freopen("tan_out.txt","w",stdout);
	scanf("%d%I64d",&n,&a0);
	sum[0][0]=sum[1][0]=0;
	for(int i=1;i<n;i++){
		scanf("%I64d",&a1);
		b[0]=a1-a0;
		b[1]=(a1-a0)*(-1);
		sum[0][i]=b[0]+sum[0][i-1];
		sum[1][i]=b[1]+sum[1][i-1];
		a0=a1;
	}
	ll ans=0;
	ll min0=0,min1=0;
	for(int i=1;i<n;i++){
		if(i & 1)min1=min(min1,sum[1][i]);
		else min0=min(min0,sum[0][i]);
		ans=max(ans,sum[0][i]-min0);
		ans=max(ans,sum[1][i]-min1);
	}
	printf("%I64d\n",ans);
	return 0;
}


#include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <list>
#include <cassert>
#include <ctime>
#include <climits>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=2e5+100;
ll arr[N],a[N];
int main() {
	ll mxf = LLONG_MIN, mxen = 0,
       start =0, end = 0, s=0,n,prod=1;
    cin>>n;
    for(int i=0;i<n;i++)
    	cin>>arr[i];
    for(int i=0;i+1<n;i++)
  	{
  		a[i]=abs(arr[i]-arr[i+1]);
  		if(i%2)
  			a[i]*=-1;
  	}
    int j=0;
    for(int i=0;i<n-1;i++)
    {
    	mxen+=a[i]*prod;
    	mxf=max(mxf,mxen);
    	if(mxen<0&&j<i)//time to end this range
    	{
    		while(1)
    		{
    			mxen-=a[j]*prod;
    			j++;
    			if(j>i)break;
    			if(j%2)//from new beginning sum will be
    				prod*=-1;
    			mxen*=prod;
    			if(mxen>0)break;
    		}
    	}
    	mxf=max(mxf,mxen);
    }
    cout<<mxf;
	return 0;
}


#include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <list>
#include <cassert>
#include <ctime>
#include <climits>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=2e5+100;
int arr[N],a[N];
int main() {
	ll mxf = LLONG_MIN, mxen = 0,
       start =0, end = 0, s=0,n,prod=1;
    cin>>n;
    for(int i=0;i<n;i++)
    	cin>>arr[i];
    for(int i=0;i+1<n;i++)
  	{
  		a[i]=abs(arr[i]-arr[i+1]);
  		if(i%2)
  			a[i]*=-1;
  	}
    for (int i=0; i<n-1; i++ )
    {
        mxen += a[i];

        if (mxf < mxen)
        {
            mxf=mxen;
            start = s;
            end = i;
        }

        if (mxen < 0)
        {
            mxen = 0;
            s = i+1;
        }
    }
    for(int i=0;i+1<n;i++)
  	{
  		a[i]=abs(arr[i]-arr[i+1]);
  		if(i%2==0)
  			a[i]*=-1;
  	}
    for (int i=0; i<n-1; i++ )
    {
        mxen += a[i];

        if (mxf < mxen)
        {
            mxf=mxen;
            start = s;
            end = i;
        }

        if (mxen < 0)
        {
            mxen = 0;
            s = i+1;
        }
    }
    cout<<mxf;
	return 0;
}


#include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <list>
#include <cassert>
#include <ctime>
#include <climits>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=2e5+100;
int arr[N],a[N];
int main() {
	ll mxf = LLONG_MIN, mxen = 0,
       start =0, end = 0, s=0,n,prod=1;
    cin>>n;
    for(int i=0;i<n;i++)
    	cin>>arr[i];
    for(int i=0;i+1<n;i++)
  	{
  		a[i]=abs(arr[i]-arr[i+1]);
  		if(i%2)
  			a[i]*=-1;
  	}

    for (int i=0; i<n-1; i++ )
    {
        mxen += a[i];

        if (mxf < mxen)
        {
            mxf=mxen;
            start = s;
            end = i;
        }

        if (mxen < 0)
        {
            mxen = 0;
            s = i+1;
        }
    }
    cout<<mxf;
	return 0;
}


#include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <list>
#include <cassert>
#include <ctime>
#include <climits>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=2e5+100;
int arr[N],a[N];
int main() {
	ll mxf = LLONG_MIN, mxen = 0,
       start =0, end = 0, s=0,n,prod=1;
    cin>>n;
    for(int i=0;i<n;i++)
    	cin>>arr[i];
    for(int i=0;i+1<n;i++)
  	{
  		a[i]=abs(arr[i]-arr[i+1]);
  		if(i%2)
  			a[i]*=-1;
  	}

    for (int i=0; i<n-1; i++ )
    {
        mxen += a[i]*prod;

        if (mxf < mxen)
        {
            mxf=mxen;
            start = s;
            end = i;
        }

        if (mxen < 0)
        {
            mxen = 0;
            s = i+1;
            if(s%2)
            	prod=-1;
            else
            	prod=1;
        }
    }
    cout<<mxf;
	return 0;
}


#include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <list>
#include <cassert>
#include <ctime>
#include <climits>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=2e5+100;
int arr[N],a[N];
int main() {
	ll mxf = LLONG_MIN, mxen = 0,
       start =0, end = 0, s=0,n,prod=1;
    cin>>n;
    for(int i=0;i<n;i++)
    	cin>>arr[i];
    for(int i=0;i+1<n;i++)
  	{
  		a[i]=abs(arr[i]-arr[i+1]);
  		if(i%2)
  			a[i]*=-1;
  	}
    for (int i=0; i<n-1; i++ )
    {
        mxen += a[i];

        if (mxf < mxen)
        {
            mxf=mxen;
            start = s;
            end = i;
        }

        if (mxen < 0)
        {
            mxen = 0;
            s = i+1;
        }
    }
    for(int i=0;i+1<n;i++)
  	{
  		a[i]=abs(arr[i]-arr[i+1]);
  		if(i%2==0)
  			a[i]*=-1;
  	}
  	mxen=0;
    for (int i=0; i<n-1; i++ )
    {
        mxen += a[i];

        if (mxf < mxen)
        {
            mxf=mxen;
            start = s;
            end = i;
        }

        if (mxen < 0)
        {
            mxen = 0;
            s = i+1;
        }
    }
    cout<<mxf;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int64_t n,i,a,b,c,d,x,y;
int main(){
for(cin>>n>>x,c=d=x;i+1<n;x=y,++i)
	cin>>y,a+=abs(y-x)*(i&1?-1:1),
	d=max(d,max(c-a,a-b)),
	i&1?b=min(b,a):c=max(c,a);
cout<<d;
}


#include<bits/stdc++.h>
using namespace std;
int n,i,s,b,c=-2e9,d=-2e9,a[100010];
int main(){
for(cin>>n>>a[0];i+1<n;++i)
	cin>>a[i+1],
	s+=abs(a[i+1]-a[i])*(i&1?-1:1),
	d=max(d,s-b),d=max(d,c-s),
	i&1?b=min(b,s):c=max(c,s);
cout<<d;
}


#include<bits/stdc++.h>
using namespace std;
int n,i,s,b,c=-2e9,d=-2e9,a[100010];
int main(){
for(cin>>n>>a[0];i+1<n;++i)
	cin>>a[i+1],
	s+=abs(a[i+1]-a[i])*(i&1?-1:1),
	d=max(d,s-b),d=max(d,c-s),
	i&1?c=max(c,s):b=min(b,s);
cout<<d;
}


#include<bits/stdc++.h>
using namespace std;
int64_t n,i,a,b,c,d,x,y;
int main(){
for(cin>>n>>x,b=c=d=x;i+1<n;x=y,++i)
	cin>>y,a+=abs(y-x)*(i&1?-1:1),
	d=max(d,max(c-a,a-b)),
	i&1?b=min(b,a):c=max(c,a);
cout<<d;
}


#include<bits/stdc++.h>
using namespace std;
int64_t n,i,a,b,c=-2e18,d=-2e18,x,y;
int main(){
for(cin>>n>>x;i+1<n;x=y,++i)
	cin>>y,a+=abs(y-x)*(i&1?-1:1),
	d=max(d,max(c-a,a-b)),
	i&1?b=min(b,a):c=max(c,a);
cout<<d;
}


#include<iostream>
#include<string.h>
#include<math.h>
#define MAX 100005
using namespace std;
int n;
long long T[MAX];
int main()
{
	cin>>n;
	int i;
	for(i=0;i<n;i++) cin>>T[i];
	for(i=0;i<n-1;i++)
	{
		T[i]=abs(T[i+1]-T[i]);
	}
	if(n==2)
	{
		cout<<T[0];
		return 0;
	}
	long long ans0=T[0];
	long long k=T[0];
	for(i=2;i<n-1;i+=2)
	{
		long long d=T[i]-T[i-1];
		k+=d;
		k=max(k,T[i]);
		ans0=max(ans0,k);
	}
	long long ans1=T[1];
	k=T[1];
	for(i=3;i<n-1;i+=2)
	{
		long long d=T[i]-T[i-1];
		k+=d;
		k=max(k,T[i]);
		ans1=max(ans1,k);
	}
	cout<<max(ans0,ans1);
	return 0;
}


#include<iostream>
#include<string.h>
#include<math.h>
#define MAX 100005
using namespace std;
int n;
int T[MAX];
int A[MAX];
int main()
{
	cin>>n;
	int i;
	for(i=0;i<n;i++) cin>>T[i];
	for(i=0;i<n-1;i++)
	{
		T[i]=abs(T[i+1]-T[i]);
	}
	long long ans0=T[0];
	long long k=T[0];
	for(i=2;i<n-1;i+=2)
	{
		long long d=T[i]-T[i-1];
		k+=d;
		if(k<0) k=T[i];
		ans0=max(ans0,k);
	}
	long long ans1=T[1];
	k=T[1];
	for(i=3;i<n-1;i+=2)
	{
		long long d=T[i]-T[i-1];
		k+=d;
		if(k<0) k=T[i];
		ans1=max(ans1,k);
	}
	cout<<max(ans0,ans1);
	return 0;
}


#include<iostream>
#include<string.h>
#include<math.h>
#define MAX 100005
using namespace std;
int n;
int T[MAX];
int A[MAX];
int main()
{
	cin>>n;
	int i;
	for(i=0;i<n;i++) cin>>T[i];
	for(i=1;i<n;i++)
	{
		T[i-1]=abs(T[i]-T[i-1]);
	}
	int ans0=T[0];
	int k=T[0];
	for(i=2;i<n-1;i+=2)
	{
		int d=T[i]-T[i-1];
		k+=d;
		if(k<0) k=0;
		ans0=max(ans0,k);
	}
	int ans1=T[1];
	k=T[1];
	for(i=3;i<n-1;i+=2)
	{
		int d=T[i]-T[i-1];
		k+=d;
		if(k<0) k=0;
		ans1=max(ans1,k);
	}
	cout<<max(ans0,ans1);
	return 0;
}


#include<iostream>
#include<string.h>
#include<math.h>
#define MAX 100005
using namespace std;
int n;
int T[MAX];
int A[MAX];
int main()
{
	cin>>n;
	int i;
	for(i=0;i<n;i++) cin>>T[i];
	for(i=1;i<n;i++)
	{
		T[i-1]=abs(T[i]-T[i-1]);
	}
	long long ans0=T[0];
	long long k=T[0];
	for(i=2;i<n-1;i+=2)
	{
		long long d=T[i]-T[i-1];
		k+=d;
		if(k<0) k=0;
		ans0=max(ans0,k);
	}
	long long ans1=T[1];
	k=T[1];
	for(i=3;i<n-1;i+=2)
	{
		long long d=T[i]-T[i-1];
		k+=d;
		if(k<0) k=0;
		ans1=max(ans1,k);
	}
	cout<<max(ans0,ans1);
	return 0;
}


#include<iostream>
#include<string.h>
#include<math.h>
#define MAX 100005
using namespace std;
int n;
long long T[MAX];
long long A[MAX];
int main()
{
	cin>>n;
	int i;
	for(i=0;i<n;i++) cin>>T[i];
	for(i=0;i<n-1;i++)
	{
		T[i]=abs(T[i+1]-T[i]);
	}
	long long ans0=T[0];
	long long k=T[0];
	for(i=2;i<n-1;i+=2)
	{
		long long d=T[i]-T[i-1];
		k+=d;
		k=max(k,T[i]);
		ans0=max(ans0,k);
	}
	long long ans1=T[1];
	k=T[1];
	for(i=3;i<n-1;i+=2)
	{
		long long d=T[i]-T[i-1];
		k+=d;
		k=max(k,T[i]);
		ans1=max(ans1,k);
	}
	cout<<max(ans0,ans1);
	return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<queue>
#include<map>
#include<cmath>
#include<vector>
#include<set>
using namespace std;
#define LL long long

int n;
int a[100005];
int dp[100005][2];

int main()
{
    while(~scanf("%d",&n))
    {
        for(int i=1;i<=n;++i)
            scanf("%d",&a[i]);
        for(int i=1;i<=n-1;++i)
            a[i]=abs(a[i+1]-a[i]);
        n--;
        memset(dp,0,sizeof(dp));
        dp[1][0]=a[1],dp[1][1]=0;
        //dp[2][0]=a[2],dp[2][1]=dp[1][0]-a[2];
        for(int i=2;i<=n;++i)
        {
            dp[i][0]=max(a[i],dp[i-1][1]+a[i]);
            dp[i][1]=dp[i-1][0]-a[i];
        }
        int maxx=-1;
        for(int i=1;i<=n;++i)
            maxx=max(max(maxx,dp[i][0]),dp[i][1]);
        printf("%d\n",maxx);
    }
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<queue>
#include<map>
#include<cmath>
#include<vector>
#include<set>
using namespace std;
#define LL long long

int n;
int a[100005];
int dp[100005][2];

int main()
{
    while(~scanf("%d",&n))
    {
        for(int i=1;i<=n;++i)
            scanf("%d",&a[i]);
        for(int i=1;i<=n-1;++i)
            a[i]=abs(a[i+1]-a[i]);
        n--;
        memset(dp,0,sizeof(dp));
        dp[1][0]=a[1],dp[1][1]=0;
        dp[2][0]=a[2],dp[2][1]=dp[1][0]-a[2];
        for(int i=3;i<=n;++i)
        {
            dp[i][0]=max(a[i],dp[i-1][1]+a[i]);
            dp[i][1]=dp[i-1][0]-a[i];
        }
        printf("%d\n",dp[n][0]);
    }
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<queue>
#include<map>
#include<cmath>
#include<vector>
#include<set>
using namespace std;
#define LL long long

int n;
int a[100005];
int dp[100005][2];

int main()
{
    while(~scanf("%d",&n))
    {
        for(int i=1;i<=n;++i)
            scanf("%d",&a[i]);
        for(int i=1;i<=n-1;++i)
            a[i]=abs(a[i+1]-a[i]);
        n--;
        memset(dp,0,sizeof(dp));
        dp[1][0]=a[1],dp[1][1]=0;
        dp[2][0]=a[2],dp[2][1]=dp[1][0]-a[2];
        for(int i=2;i<=n;++i)
        {
            dp[i][0]=max(a[i],dp[i-1][1]+a[i]);
            dp[i][1]=dp[i-1][0]-a[i];
        }
        int maxx=-1;
        for(int i=1;i<=n;++i)
            maxx=max(maxx,dp[i][0]);
        printf("%d\n",maxx);
    }
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<queue>
#include<map>
#include<cmath>
#include<vector>
#include<set>
using namespace std;
#define LL long long

int n;
LL a[100005];
LL dp[100005][2];

int main()
{
    while(~scanf("%d",&n))
    {
        for(int i=1;i<=n;++i)
            scanf("%lld",&a[i]);
        for(int i=1;i<=n-1;++i)
            a[i]=abs(a[i+1]-a[i]);
        n--;
        memset(dp,0,sizeof(dp));
        dp[1][0]=a[1],dp[1][1]=0;
        for(int i=2;i<=n;++i)
        {
            dp[i][0]=max(a[i],dp[i-1][1]+a[i]);
            dp[i][1]=dp[i-1][0]-a[i];
        }
        LL maxx=-1;
        for(int i=1;i<=n;++i)
            maxx=max(maxx,dp[i][0]);
        printf("%lld\n",maxx);
    }
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<queue>
#include<map>
#include<cmath>
#include<vector>
#include<set>
using namespace std;
#define LL long long

int n;
LL a[100005];
LL dp[100005][2];

int main()
{
    while(~scanf("%d",&n))
    {
        for(int i=1;i<=n;++i)
            scanf("%lld",&a[i]);
        for(int i=1;i<=n-1;++i)
            a[i]=abs(a[i+1]-a[i]);
        n--;
        memset(dp,0,sizeof(dp));
        dp[1][0]=a[1],dp[1][1]=0;
        //dp[2][0]=a[2],dp[2][1]=dp[1][0]-a[2];
        for(int i=2;i<=n;++i)
        {
            dp[i][0]=max(a[i],dp[i-1][1]+a[i]);
            dp[i][1]=dp[i-1][0]-a[i];
        }
        LL maxx=-1;
        for(int i=1;i<=n;++i)
            maxx=max(max(maxx,dp[i][0]),dp[i][1]);
        printf("%lld\n",maxx);
    }
}


#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <string>
#include <vector>
#include <iostream>
#include <algorithm>
#include <numeric>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <fstream>
#include <iomanip>
#include <assert.h>

#ifdef DK

#include "Tool.hh"

#endif

using namespace std;

#ifdef DK
const int MAX = 100;
#else
const int MAX = (const int) (1e5 + 11);
#endif

int N;
int64_t A[MAX];
int64_t S[2][MAX];
int64_t P[2][MAX];

const int64_t INF = (const int64_t) 1e18;

static int64_t f(int id, int a, int b) {
    return S[id][b + 1] - S[id][a];
}

static void brute() {
    std::cout << "\n#####\n";
    int64_t res = 0, a = 0, b = 0;
    for (int i = 0; i < N; ++i) {
        for (int j = i + 1; j < N; ++j) {
            int64_t sum = 0;
            for (int k = i; k <= j; ++k) {
                sum += A[k] * ((k - i) & 1 ? -1 : +1);
            }
            if (res < sum) {
                res = sum;
                a = i;
                b = j;
            }
            res = max(res, sum);
        }
    }
    std::cout << res << " " << a << " " << b;
    std::cout << "\n#####\n";
}

static void solve(std::int32_t test) {
    memset(S, 0x00, sizeof(S));
    for (int id = 0; id < 2; ++id)
        for (int i = 0; i < MAX; ++i)
            P[id][i] = +INF;

    cin >> N;
    for (int i = 0; i < N; ++i)
        cin >> A[i];
    N--;
    for (int i = 0; i < N; ++i)
        A[i] = abs(A[i + 1] - A[i]);
    for (int i = 0; i < N; ++i) {
        S[0][i + 1] = S[0][i] + A[i] * (i & 1 ? -1 : +1);
        S[1][i + 1] = S[1][i] + A[i] * (i & 1 ? +1 : -1);
    }
    for (int i = N - 1; i >= 0; --i) {
        P[0][i] = min(P[0][i + 1], f(0, i, N - 1));
        P[1][i] = min(P[1][i + 1], f(1, i, N - 1));
    }
    int64_t res = f(0, 0, N - 1);
    for (int i = 0; i < N; ++i) {
        int id = i & 1;
        res = max(res, f(id, i, N - 1) - P[id][i + 1]);
    }
    cout << res;
}

int main() {
    ios_base::sync_with_stdio(0);
    cout << setprecision(12) << fixed;
#ifdef DK
    tool::run_task(tool::Task::C, solve);
#else
    solve(0);
#endif
    return 0;
}


#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <string>
#include <vector>
#include <iostream>
#include <algorithm>
#include <numeric>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <fstream>
#include <iomanip>
#include <assert.h>

#ifdef DK

#include "Tool.hh"

#endif

using namespace std;

#ifdef DK
const int MAX = 100;
#else
const int MAX = (const int) (1e5 + 11);
#endif

int N;
int64_t A[MAX];
int64_t D[MAX][5];

static int64_t f(int a, int e, int t = 1) {
    if (a >= N)
        return 0;
    if (D[a][e] != -1)
        return D[a][e];
    if (e == 1) {
        auto y = t * A[a] + f(a + 1, 1, -t);
        auto x = t * A[a];
        return D[a][e] = max(x, y);
    }
    return D[a][e] = 0;

}

static void solve(std::int32_t test) {
    memset(D, 0xFF, sizeof(D));

    cin >> N;
    for (int i = 0; i < N; ++i)
        cin >> A[i];
    for (int i = 1; i < N; ++i)
        A[i - 1] = abs(A[i] - A[i - 1]);
    N--;
    auto r1 = f(0, 1);
    auto r2 = f(0, 0);
    cout << max(r1, r2);
}

int main() {
    ios_base::sync_with_stdio(0);
    cout << setprecision(12) << fixed;
#ifdef DK
    tool::run_task(tool::Task::C, solve);
#else
    solve(0);
#endif
    return 0;
}


#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <string>
#include <vector>
#include <iostream>
#include <algorithm>
#include <numeric>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <fstream>
#include <iomanip>
#include <assert.h>

#ifdef DK

#include "Tool.hh"

#endif

using namespace std;

#ifdef DK
const int MAX = 100;
#else
const int MAX = (const int) (1e5 + 11);
#endif

int N;
int64_t A[MAX];
int64_t S[2][MAX];
int64_t P[2][MAX];

const int64_t INF = (const int64_t) 1e18;

static int64_t f(int id, int a, int b) {
    return S[id][b + 1] - S[id][a];
}

static void brute() {
    std::cout << "\n#####\n";
    int64_t res = 0, a = 0, b = 0;
    for (int i = 0; i < N; ++i) {
        for (int j = i + 1; j < N; ++j) {
            int64_t sum = 0;
            for (int k = i; k <= j; ++k) {
                sum += A[k] * ((k - i) & 1 ? -1 : +1);
            }
            if (res < sum) {
                res = sum;
                a = i;
                b = j;
            }
            res = max(res, sum);
        }
    }
    std::cout << res << " " << a << " " << b;
    std::cout << "\n#####\n";
}

static void solve(std::int32_t test) {
    memset(S, 0x00, sizeof(S));
    for (int id = 0; id < 2; ++id)
        for (int i = 0; i < MAX; ++i)
            P[id][i] = +INF;
    cin >> N;
    for (int i = 0; i < N; ++i)
        cin >> A[i];
    N--;
    for (int i = 0; i < N; ++i)
        A[i] = abs(A[i + 1] - A[i]);
    for (int i = 0; i < N; ++i) {
        S[0][i + 1] = S[0][i] + A[i] * (i & 1 ? -1 : +1);
        S[1][i + 1] = S[1][i] + A[i] * (i & 1 ? +1 : -1);
    }
    P[0][N] = 0;
    P[1][N] = 0;
    for (int i = N - 1; i >= 0; --i) {
        P[0][i] = min(P[0][i + 1], f(0, i, N - 1));
        P[1][i] = min(P[1][i + 1], f(1, i, N - 1));
    }
    int64_t res = -INF;
    for (int i = 0, id = 0; i < N; ++i, id = i & 1)
        res = max(res, f(id, i, N - 1) - P[id][i + 1]);
    cout << res;
//    brute();
}

int main() {
    ios_base::sync_with_stdio(0);
    cout << setprecision(12) << fixed;
#ifdef DK
    tool::run_task(tool::Task::C, solve);
#else
    solve(0);
#endif
    return 0;
}


#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <string>
#include <vector>
#include <iostream>
#include <algorithm>
#include <numeric>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <fstream>
#include <iomanip>
#include <assert.h>

#ifdef DK

#include "Tool.hh"

#endif

using namespace std;

#ifdef DK
const int MAX = 100;
#else
const int MAX = (const int) (1e5 + 11);
#endif

int N;
int64_t A[MAX];
int64_t S[2][MAX];
int64_t P[2][MAX];

const int64_t INF = (const int64_t) 1e18;

static int64_t f(int id, int a, int b) {
    return S[id][b + 1] - S[id][a];
}

static void brute() {
    std::cout << "\n#####\n";
    int64_t res = 0, a = 0, b = 0;
    for (int i = 0; i < N; ++i) {
        for (int j = i + 1; j < N; ++j) {
            int64_t sum = 0;
            for (int k = i; k <= j; ++k) {
                sum += A[k] * ((k - i) & 1 ? -1 : +1);
            }
            if (res < sum) {
                res = sum;
                a = i;
                b = j;
            }
            res = max(res, sum);
        }
    }
    std::cout << res << " " << a << " " << b;
    std::cout << "\n#####\n";
}

static void solve(std::int32_t test) {
    memset(S, 0x00, sizeof(S));
    for (int id = 0; id < 2; ++id)
        for (int i = 0; i < MAX; ++i)
            P[id][i] = +INF;

    cin >> N;
    for (int i = 0; i < N; ++i)
        cin >> A[i];
    N--;
    for (int i = 0; i < N; ++i)
        A[i] = abs(A[i + 1] - A[i]);
    for (int i = 0; i < N; ++i) {
        S[0][i + 1] = S[0][i] + A[i] * (i & 1 ? -1 : +1);
        S[1][i + 1] = S[1][i] + A[i] * (i & 1 ? +1 : -1);
    }
    for (int i = N - 1; i >= 0; --i) {
        P[0][i] = min(P[0][i + 1], f(0, i, N - 1));
        P[1][i] = min(P[1][i + 1], f(1, i, N - 1));
    }
    int64_t res = max(f(0, 0, N - 1), A[N - 1]);
    for (int i = 0; i < N; ++i) {
        int id = i & 1;
        res = max(res, f(id, i, N - 1) - P[id][i]);
    }
    cout << res;
}

int main() {
    ios_base::sync_with_stdio(0);
    cout << setprecision(12) << fixed;
#ifdef DK
    tool::run_task(tool::Task::C, solve);
#else
    solve(0);
#endif
    return 0;
}


#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <string>
#include <vector>
#include <iostream>
#include <algorithm>
#include <numeric>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <fstream>
#include <iomanip>
#include <assert.h>

#ifdef DK

#include "Tool.hh"

#endif

using namespace std;

#ifdef DK
const int MAX = 100;
#else
const int MAX = (const int) (1e5 + 11);
#endif

int N;
int64_t A[MAX];
int64_t D[MAX][5];

static int64_t f(int a, int e, int t = 1) {
    if (a >= N)
        return 0;
    if (D[a][e] != -1)
        return D[a][e];
    if (e == 1) {
        auto y = t * A[a] + f(a + 1, 1, -t);
        auto x = t * A[a];
        return D[a][e] = max(x, y);
    }
    return D[a + 1][1] = f(a + 1, 1);

}

static void solve(std::int32_t test) {
    memset(D, 0xFF, sizeof(D));

    cin >> N;
    for (int i = 0; i < N; ++i)
        cin >> A[i];
    for (int i = 1; i < N; ++i)
        A[i - 1] = abs(A[i] - A[i - 1]);
    N--;
    cout << f(0, 1);
}

int main() {
    ios_base::sync_with_stdio(0);
    cout << setprecision(12) << fixed;
#ifdef DK
    tool::run_task(tool::Task::C, solve);
#else
    solve(0);
#endif
    return 0;
}


#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <string>
#include <vector>
#include <iostream>
#include <algorithm>
#include <numeric>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <fstream>
#include <iomanip>
#include <assert.h>

#ifdef DK

#include "Tool.hh"

#endif

using namespace std;

#ifdef DK
const int MAX = 100;
#else
const int MAX = (const int) (1e5 + 11);
#endif

int N;
int A[MAX];
int64_t D[MAX][5];

static int64_t f(int a, int e, int t = 1) {
    if (a >= N)
        return 0;
    if (D[a][e] != -1)
        return D[a][e];
    if (e == 1) {
        auto y = t * A[a] + f(a + 1, 1, -t);
        auto x = t * A[a] + f(a + 1, 0, -t);
        return D[a][e] = max(x, y);
    }
    auto y = t * f(a + 1, 1, t);
    auto x = t * f(a + 1, 0, t);
    return D[a][e] = max(x, y);

}

static void solve(std::int32_t test) {
    memset(D, 0xFF, sizeof(D));

    cin >> N;
    for (int i = 0; i < N; ++i)
        cin >> A[i];
    for (int i = 1; i < N; ++i)
        A[i - 1] = abs(A[i] - A[i - 1]);
    N--;
    auto r1 = f(0, 1);
    auto r2 = f(0, 0);
    cout << max(r1, r2);
}

int main() {
    ios_base::sync_with_stdio(0);
    cout << setprecision(12) << fixed;
#ifdef DK
    tool::run_task(tool::Task::C, solve);
#else
    solve(0);
#endif
    return 0;
}


#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <string>
#include <vector>
#include <iostream>
#include <algorithm>
#include <numeric>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <fstream>
#include <iomanip>
#include <assert.h>

#ifdef DK

#include "Tool.hh"

#endif

using namespace std;

#ifdef DK
const int MAX = 100;
#else
const int MAX = (const int) (1e5 + 11);
#endif

int N;
int64_t A[MAX];
int64_t S[2][MAX];
int64_t P[2][MAX];

const int64_t INF = (const int64_t) 1e18;

static int64_t f(int id, int a, int b) {
    return S[id][b + 1] - S[id][a];
}

static void brute() {
    std::cout << "\n#####\n";
    int64_t res = 0, a = 0, b = 0;
    for (int i = 0; i < N; ++i) {
        for (int j = i + 1; j < N; ++j) {
            int64_t sum = 0;
            for (int k = i; k <= j; ++k) {
                sum += A[k] * ((k - i) & 1 ? -1 : +1);
            }
            if (res < sum) {
                res = sum;
                a = i;
                b = j;
            }
            res = max(res, sum);
        }
    }
    std::cout << res << " " << a << " " << b;
    std::cout << "\n#####\n";
}

static void solve(std::int32_t test) {
    memset(S, 0x00, sizeof(S));
    for (int id = 0; id < 2; ++id)
        for (int i = 0; i < MAX; ++i)
            P[id][i] = +INF;

    cin >> N;
    for (int i = 0; i < N; ++i)
        cin >> A[i];
    N--;
    for (int i = 0; i < N; ++i)
        A[i] = abs(A[i + 1] - A[i]);
    for (int i = 0; i < N; ++i) {
        S[0][i + 1] = S[0][i] + A[i] * (i & 1 ? -1 : +1);
        S[1][i + 1] = S[1][i] + A[i] * (i & 1 ? +1 : -1);
    }
    for (int i = N - 1; i >= 0; --i) {
        P[0][i] = min(P[0][i + 1], f(0, i, N - 1));
        P[1][i] = min(P[1][i + 1], f(1, i, N - 1));
    }
    int64_t res = max(f(0, 0, N - 1), A[N - 1]);
    for (int i = 0; i < N; ++i) {
        int id = i & 1;
        res = max(res, f(id, i, N - 1) - P[id][i + 1]);
    }
    cout << res;
}

int main() {
    ios_base::sync_with_stdio(0);
    cout << setprecision(12) << fixed;
#ifdef DK
    tool::run_task(tool::Task::C, solve);
#else
    solve(0);
#endif
    return 0;
}


#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <string>
#include <vector>
#include <iostream>
#include <algorithm>
#include <numeric>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <fstream>
#include <iomanip>
#include <assert.h>

#ifdef DK

#include "Tool.hh"

#endif

using namespace std;

#ifdef DK
const int MAX = 100;
#else
const int MAX = (const int) (1e5 + 11);
#endif

int N;
int64_t A[MAX];
int64_t D[MAX][5];

static int64_t f(int a, int e, int t = 1) {
    if (a >= N)
        return 0;
    if (D[a][e] != -1)
        return D[a][e];
    if (e == 1) {
        auto y = t * A[a] + f(a + 1, 1, -t);
        auto x = t * A[a];
        return D[a][e] = max(x, y);
    }
    auto y = f(a + 1, 1, t);
    auto x = 0LL;
    return D[a][e] = max(x, y);

}

static void solve(std::int32_t test) {
    memset(D, 0xFF, sizeof(D));

    cin >> N;
    for (int i = 0; i < N; ++i)
        cin >> A[i];
    for (int i = 1; i < N; ++i)
        A[i - 1] = abs(A[i] - A[i - 1]);
    N--;
    auto r1 = f(0, 1);
    auto r2 = f(0, 0);
    cout << max(r1, r2);
}

int main() {
    ios_base::sync_with_stdio(0);
    cout << setprecision(12) << fixed;
#ifdef DK
    tool::run_task(tool::Task::C, solve);
#else
    solve(0);
#endif
    return 0;
}


#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <string>
#include <vector>
#include <iostream>
#include <algorithm>
#include <numeric>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <fstream>
#include <iomanip>
#include <assert.h>

#ifdef DK

#include "Tool.hh"

#endif

using namespace std;

#ifdef DK
const int MAX = 100;
#else
const int MAX = (const int) (1e5 + 11);
#endif

int N;
int64_t A[MAX];
int64_t D[MAX][5];
int64_t glb;

static int64_t f(int a, int p = 0, int t = 1) {
    if (a >= N)
        return 0;
    if (D[a][p] != -1)
        return D[a][p];
    if (p == 0) {
        auto r1 = f(a + 1, 0);
        auto r2 = f(a + 1, 1);
        return D[a][p] = max(r1, r2);
    }
    auto r1 = t * A[a] + f(a + 1, 1, -t);
    glb = max(glb, r1);
    return t * A[a];
}

static void solve(std::int32_t test) {
    memset(D, 0xFF, sizeof(D));
    glb = 0;

    cin >> N;
    for (int i = 0; i < N; ++i)
        cin >> A[i];
    for (int i = 1; i < N; ++i)
        A[i - 1] = abs(A[i] - A[i - 1]);
    N--;
    cout << max(f(0), glb);
}

int main() {
    ios_base::sync_with_stdio(0);
    cout << setprecision(12) << fixed;
#ifdef DK
    tool::run_task(tool::Task::C, solve);
#else
    solve(0);
#endif
    return 0;
}


#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <string>
#include <vector>
#include <iostream>
#include <algorithm>
#include <numeric>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <fstream>
#include <iomanip>
#include <assert.h>

#ifdef DK

#include "Tool.hh"

#endif

using namespace std;

#ifdef DK
const int MAX = 100;
#else
const int MAX = (const int) (1e5 + 11);
#endif

int N;
int64_t A[MAX];
int64_t S[2][MAX];
int64_t P[2][MAX];

const int64_t INF = (const int64_t) 1e18;

static int64_t f(int id, int a, int b) {
    return S[id][b + 1] - S[id][a];
}

static void brute() {
    std::cout << "\n#####\n";
    int64_t res = 0, a = 0, b = 0;
    for (int i = 0; i < N; ++i) {
        for (int j = i + 1; j < N; ++j) {
            int64_t sum = 0;
            for (int k = i; k <= j; ++k) {
                sum += A[k] * ((k - i) & 1 ? -1 : +1);
            }
            if (res < sum) {
                res = sum;
                a = i;
                b = j;
            }
            res = max(res, sum);
        }
    }
    std::cout << res << " " << a << " " << b;
    std::cout << "\n#####\n";
}

static void solve(std::int32_t test) {
    memset(S, 0x00, sizeof(S));
    for (int id = 0; id < 2; ++id)
        for (int i = 0; i < MAX; ++i)
            P[id][i] = +INF;

    cin >> N;
    for (int i = 0; i < N; ++i)
        cin >> A[i];
    N--;
    for (int i = 0; i < N; ++i)
        A[i] = abs(A[i + 1] - A[i]);
    for (int i = 0; i < N; ++i) {
        S[0][i + 1] = S[0][i] + A[i] * (i & 1 ? -1 : +1);
        S[1][i + 1] = S[1][i] + A[i] * (i & 1 ? +1 : -1);
    }
    for (int i = N - 1; i >= 0; --i) {
        P[0][i] = min(P[0][i + 1], f(0, i, N - 1));
        P[1][i] = min(P[1][i + 1], f(1, i, N - 1));
    }
    int64_t res = f(0, 0, N - 1);
    for (int i = 0; i < N; ++i) {
        int id = i & 1;
        res = max(res, f(id, i, N - 1) - P[id][i]);
    }
    cout << res;
}

int main() {
    ios_base::sync_with_stdio(0);
    cout << setprecision(12) << fixed;
#ifdef DK
    tool::run_task(tool::Task::C, solve);
#else
    solve(0);
#endif
    return 0;
}


#include <algorithm>
#include <iostream>
using namespace std;

const int N = 100000 + 10;
int a[N];
long long d[N], s[N], t[N];
int n;

int main() {
    ios::sync_with_stdio(false);
    cin >> n;
    for (int i = 0; i < n; i++)
        cin >> a[i];
    for (int i = 0; i < n - 1; i++) {
        d[i] = a[i] - a[i + 1];
        if (d[i] < 0) d[i] = -d[i];
    }

    s[n - 2] = t[n - 2] = d[n - 2];
    for (int i = n - 3; i >= 0; i--) {
        s[i] = max(d[i] - t[i + 1], d[i]);
        t[i] = min(d[i] - s[i + 1], d[i]);
    }
    long long mx = INT64_MIN;
    for (int i = 0; i < n - 1; i++)
        mx = max(mx, s[i]);

    cout << mx << endl;

    return 0;
}


#include <algorithm>
#include <iostream>
using namespace std;

const int N = 100 + 10;
int a[N], d[N], s[N], t[N];
int n;

int main() {
    ios::sync_with_stdio(false);
    cin >> n;
    for (int i = 0; i < n; i++)
        cin >> a[i];
    for (int i = 0; i < n - 1; i++) {
        d[i] = a[i] - a[i + 1];
        if (d[i] < 0) d[i] = -d[i];
    }

    s[n - 2] = t[n - 2] = d[n - 2];
    for (int i = n - 3; i >= 0; i--) {
        s[i] = max(d[i] - t[i + 1], 0);
        t[i] = min(d[i] - s[i + 1], 0);
    }

    cout << s[0] << endl;

    return 0;
}


#include <algorithm>
#include <iostream>
using namespace std;

const long long N = 100000 + 10;
long long a[N], d[N], s[N], t[N];
long long n;

int main() {
    ios::sync_with_stdio(false);
    cin >> n;
    for (long long i = 0; i < n; i++)
        cin >> a[i];
    for (long long i = 0; i < n - 1; i++) {
        d[i] = a[i] - a[i + 1];
        if (d[i] < 0) d[i] = -d[i];
    }

    s[n - 2] = t[n - 2] = d[n - 2];
    for (long long i = n - 3; i >= 0; i--) {
        s[i] = max(d[i] - t[i + 1], d[i]);
        t[i] = min(d[i] - s[i + 1], d[i]);
    }

    cout << s[0] << endl;

    return 0;
}