#include <bits/stdc++.h>
using namespace std;
int r, x, y;
bool check(int seed) {
  int i = (seed / 50) % 475;
  for (int t = 0; t < 25; t++) {
    i = (i * 96 + 42) % 475;
    if (26 + i == r) return 1;
  }
  return 0;
}
int main() {
  cin >> r >> x >> y;
  int w = x;
  while (w >= y) {
    if (check(w)) {
      puts("0");
      return 0;
    }
    w -= 50;
  }
  for (int i = 1;; i++) {
    if (check(x + 100 * i) || check(x + 100 * i - 50)) {
      printf("%d\n", i);
      return 0;
    }
  }
}
