#include <bits/stdc++.h>
using namespace std;
long long A[100005], f[100005], d[100005];
int main() {
  long long n;
  cin >> n;
  f[0] = 0;
  for (long long i = 0; i < n; i++) {
    cin >> A[i];
    if (i) {
      d[i - 1] = abs(A[i] - A[i - 1]);
      if (i % 2)
        f[i] = f[i - 1] + d[i - 1];
      else
        f[i] = f[i - 1] - d[i - 1];
    }
  }
  sort(f, f + n);
  cout << f[n - 1] - f[0];
  return 0;
}
