#include <bits/stdc++.h>
using namespace std;
const double PI = 2 * acos(0);
const double eps = 1e-9;
const long long inf = 1e10;
int n;
vector<vector<int> > g;
set<int> burned;
int res = 0;
int fre[1009];
set<int> winners(int s) {
  set<int> sol;
  int x = (s / 50) % 475;
  for (int i = 0; i < (int)(25); i++) {
    x = (x * 96 + 42) % 475;
    sol.insert(26 + x);
  }
  return sol;
}
void solve() {}
int main() {
  int p, x, y;
  cin >> p >> x >> y;
  int npoints = x;
  while (npoints >= y) {
    set<int> sol = winners(npoints);
    if (sol.find(p) != sol.end()) {
      cout << 0 << endl;
      return 0;
    }
    npoints -= 50;
  }
  for (int i = 1; i < 123456; i++) {
    set<int> sol = winners(x + 50 * i);
    if (sol.find(p) != sol.end()) {
      cout << (i + 1) / 2 << endl;
      return 0;
    }
  }
  return 0;
}
