#include <bits/stdc++.h>
using namespace std;
bool chk(int s, int r) {
  int a = (s / 50) % 475;
  for (int i = 0; i < 25; i++) {
    a = (a * 96 + 42) % 475;
    if (r == 26 + a) return 1;
  }
  return 0;
}
int main() {
  int p, x, y, score;
  cin >> p >> x >> y;
  if (x > y) {
    score = x;
    while (score >= y) {
      if (chk(score, p)) {
        cout << 0;
        return 0;
      } else
        score -= 50;
    }
  }
  score = x;
  while (!chk(score, p)) score += 50;
  score = score - x;
  cout << ceil((score + 0.0) / 100);
  return 0;
}
