#include <bits/stdc++.h>
using namespace std;
set<int> seen;
vector<int> winners(int score) {
  int i = (score / 50) % 475;
  if (seen.count(i)) return {};
  seen.insert(i);
  vector<int> res;
  for (int w = 0, _n = (25); w < _n; ++w) {
    i = (i * 96 + 42) % 475;
    res.push_back(26 + i);
  }
  return res;
}
int P, X, Y;
int solve() {
  for (int x = X; x >= Y; x -= 50) {
    vector<int> w = winners(x);
    if (find(w.begin(), w.end(), P) != w.end()) return 0;
  }
  int res = 0;
  for (int x = X + 100;; x += 100) {
    res++;
    vector<int> w = winners(x);
    if (find(w.begin(), w.end(), P) != w.end()) break;
    w = winners(x - 50);
    if (find(w.begin(), w.end(), P) != w.end()) break;
  }
  return res;
}
int main(int argc, char* argv[]) {
  cin >> P >> X >> Y;
  cout << solve() << '\n';
  return 0;
}
