#include <bits/stdc++.h>
using namespace std;
int ans;
bool acm(int p, int x) {
  int s, i;
  s = (x / 50) % 475;
  for (i = 1; i <= 25; i++) {
    s = (s * 96 + 42) % 475;
    if (p == (s + 26)) return true;
  }
  return false;
}
void cmp(int p, int x, int y) {
  int num;
  num = 0;
  int xi = x;
  while (xi >= y) {
    if (acm(p, xi)) {
      cout << ans << endl;
      return;
    }
    xi -= 50;
  }
  while (x >= y) {
    x += 50;
    num++;
    if (num % 2 == 1) ans++;
    if (acm(p, x)) {
      cout << ans << endl;
      return;
    }
  }
}
int main() {
  int p, x, y;
  while (cin >> p >> x >> y) {
    ans = 0;
    if (x < y) {
      x += 100;
      ans++;
    }
    cmp(p, x, y);
  }
  return 0;
}
