#include <bits/stdc++.h>
using namespace std;
bool sus(long long int sc, long long int p) {
  int i = (sc / 50) % 475;
  map<int, bool> mp;
  for (int j = 1; j <= 25; ++j) {
    i = (i * 96 + 42) % 475;
    mp[26 + i] = true;
  }
  if (mp.find(p) != mp.end()) return true;
  return false;
}
int main() {
  long long int p, x, y, n, diff;
  cin >> p >> x >> y;
  bool res = false;
  n = x;
  while (res != true && n >= y) {
    res = sus(n, p);
    if (res == true) {
      cout << 0 << endl;
      return 0;
    }
    n = n - 50;
  }
  n = x;
  while (res != true) {
    res = sus(n, p);
    if (res == true) {
      diff = n - x;
      if (diff % 100 == 0)
        cout << diff / 100 << endl;
      else
        cout << (diff + 50) / 100 << endl;
      return 0;
    }
    n = n + 50;
  }
  return 0;
}
