#include <bits/stdc++.h>
using namespace std;
char s[111111];
int a[111111];
int ans[111111];
int main() {
  memset(a, 0, sizeof a);
  memset(ans, 0, sizeof ans);
  scanf("%s", &s);
  int len = strlen(s);
  for (int i = 1; i <= len; i++) {
    a[i] = s[i - 1] - '0';
  }
  int l = 1, r = len;
  int fa = 1;
  if (a[l] != a[r]) {
    a[l]--;
    a[l + 1] += 10;
    if (a[l] == 0) l++;
  }
  while (l <= r) {
    if (a[l] != a[r]) {
      if (a[l] - a[r] >= 10) {
        a[r] += 10;
        a[r - 1]--;
      }
      if (a[l] - a[r] == 1) {
        a[l]--;
        a[l + 1] += 10;
      }
    }
    if (a[l] != a[r]) {
      fa = 0;
      break;
    }
    if (l != r) {
      ans[l] = a[l] - a[r] / 2;
      ans[r] = a[r] / 2;
    } else {
      if (a[l] & 1) {
        fa = 0;
        break;
      }
      ans[l] = a[r] / 2;
    }
    if (ans[l] < 0 || ans[l] > 9 || ans[r] < 0 || ans[l] > 9) {
      fa = 0;
      break;
    }
    l++;
    r--;
  }
  if (l <= r) {
    fa = 0;
  }
  if (fa == 0) {
    printf("0\n");
    return 0;
  }
  int head = 1;
  if (ans[head] == 0) head++;
  for (int i = head; i <= len; i++) {
    printf("%d", ans[i]);
  }
  return 0;
}
