#include <bits/stdc++.h>
using namespace std;
deque<int> check(deque<int> mas) {
  int l = 0, r = mas.size() - 1;
  bool flag = true;
  for (; l < mas.size() / 2; l++, r--) {
    if (mas[r] < 0) {
      mas[r - 1]--;
      mas[r] += 10;
    }
    if (mas[l] == mas[r] + 1 && l != r - 1) {
      mas[l + 1] += 10;
      mas[l]--;
    }
    if (mas[l] == mas[r] + 10 && l != r - 1) {
      mas[r - 1]--;
      mas[r] += 10;
    }
    if (mas[l] == mas[r] + 11) {
      mas[l]--;
      mas[l + 1] += 10;
      if (l != r - 1) {
        mas[r] += 10;
        mas[r - 1]--;
      }
    }
    if (mas[l] != mas[r]) {
      flag = false;
      break;
    }
    if (mas[l] > 18) {
      flag = false;
      break;
    }
  }
  if (flag == false || mas[0] == 0 || mas[mas.size() - 1] == 0) {
    deque<int> ans;
    ans.push_back(0);
    return ans;
  } else {
    if (mas.size() % 2 == 1 && (mas[l] % 2 == 1 || mas[l] < 0)) {
      deque<int> ans;
      ans.push_back(0);
      return ans;
    } else {
      deque<int> ans = mas;
      l = 0;
      r = mas.size() - 1;
      for (; l < mas.size() / 2; l++, r--) {
        ans[l] = mas[l] - mas[l] / 2;
        ans[r] = mas[l] - ans[l];
      }
      if (mas.size() % 2 == 1) {
        ans[l] = mas[l] / 2;
      }
      return ans;
    }
  }
}
int main() {
  deque<int> x1;
  char c;
  while (cin >> c) x1.push_back(int(c) - int('0'));
  deque<int> x2 = x1;
  if (x2.size() >= 2) {
    x2[1] += x2[0] * 10;
    x2.pop_front();
  }
  deque<int> ans1 = check(x1);
  deque<int> ans2 = check(x2);
  if (ans1.size() > ans2.size()) {
    for (int i = 0; i < ans1.size(); i++) cout << ans1[i];
  } else {
    for (int i = 0; i < ans2.size(); i++) cout << ans2[i];
  }
  return 0;
}
