#include <bits/stdc++.h>
using namespace std;
const double PI = 3.1415926535;
long long powi(long long base, int p) {
  long long res = 1;
  while (p--) res *= base;
  return res;
}
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
bool is_vowel(char c) {
  c = tolower(c);
  return c == 'a' || c == 'e' || c == 'o' || c == 'i' || c == 'u' || c == 'y';
}
bool gen(int s, int p) {
  int i = (s / 50) % 475;
  for (int t = 0; t < 25; t++) {
    i = (i * 96 + 42) % 475;
    if (26 + i == p) return true;
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int p, x, y;
  cin >> p >> x >> y;
  int res = 0;
  int neg = x;
  while (neg >= y && !gen(neg, p)) neg -= 50;
  if (neg >= y) {
    cout << 0;
    return 0;
  }
  while (!gen(x, p)) {
    res++;
    x += 100;
    if (gen(x - 50, p)) break;
  }
  cout << res;
  return 0;
}
