#include <bits/stdc++.h>
using namespace std;
bool find(char *s) {
  if (*s == '-') s++;
  while (*s != '\0') {
    if (*s == '8') return 1;
    s++;
  }
  return 0;
}
int main() {
  char s[100];
  int n, m = 0;
  scanf("%s", s);
  sscanf(s, "%d", &n);
  do {
    n++;
    m++;
    sprintf(s, "%d", n);
  } while (!find(s));
  printf("%d\n", m);
  return 0;
}
