#include <bits/stdc++.h>
using namespace std;
inline long long rd() {
  long long x = 0;
  int ch = getchar(), f = 1;
  while (!isdigit(ch) && (ch != '-') && (ch != EOF)) ch = getchar();
  if (ch == '-') {
    f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = (x << 1) + (x << 3) + ch - '0';
    ch = getchar();
  }
  return x * f;
}
inline void rt(long long x) {
  if (x < 0) putchar('-'), x = -x;
  if (x >= 10)
    rt(x / 10), putchar(x % 10 + '0');
  else
    putchar(x + '0');
}
int p, x, y, t;
bool check() {
  int i = (x / 50) % 475;
  for (int j = 1; j <= (int)(25); j++) {
    i = (i * 96 + 42) % 475;
    if (i + 26 == p) return 1;
  }
  return 0;
}
int main() {
  p = rd(), x = rd(), y = rd();
  t = x;
  while (x >= y) x -= 50;
  x += 50;
  while (!check()) x += 50;
  printf("%d\n", max(0, (x - t + 50) / 100));
}
