#include <bits/stdc++.h>
using namespace std;
set<int> ss;
void solve(int x) {
  ss.clear();
  int i = (x / 50) % 475;
  for (int ii = 0; ii < 25; ii++) {
    i = (i * 96 + 42) % 475;
    ss.insert(26 + i);
  }
}
int main() {
  int p, x, y;
  int ans = 0;
  cin >> p >> x >> y;
  ss.clear();
  int pp = 50;
  int flag = 1;
  while (x - pp >= y) {
    solve(x - pp);
    if (ss.count(p)) {
      ans = 0;
      flag = 0;
    }
    pp += 50;
  }
  int aa = 50;
  solve(x);
  if (ss.count(p))
    ans = 0;
  else if (flag) {
    solve(x + aa);
    while (!ss.count(p)) {
      aa += 50;
      solve(x + aa);
    }
    ans = aa / 50;
    ans = (ans + 1) / 2;
  }
  cout << ans;
  return 0;
}
