#include <bits/stdc++.h>
using namespace std;
const int m = 475;
int a[25];
int Try(int copy_i, int i, int s);
void kalb(int copy_i, int p, int x, int y) {
  int counter = 0;
  while (Try(copy_i, p, x) == 0 && x >= y) {
    x += 50;
    counter += 1;
  }
  if (counter % 2 == 1)
    cout << (counter + 1) / 2;
  else
    cout << counter / 2;
}
bool kalb_2(int copy_i, int p, int x, int y) {
  while (Try(copy_i, p, x) == 0 && x >= y) {
    x -= 50;
  }
  if (Try(copy_i, p, x) && x >= y)
    return 1;
  else
    return 0;
}
int Try(int copy_i, int i, int s) {
  int counter = 0, t = 25;
  i = (s / 50) % m;
  while (t--) {
    i = (i * 96 + 42) % m;
    if (copy_i == (26 + i)) return 1;
  }
  return 0;
}
int main() {
  int p, x, y;
  cin >> p >> x >> y;
  if (Try(p, p, x) == 1)
    cout << 0;
  else if (kalb_2(p, p, x, y) == 1)
    cout << 0;
  else
    kalb(p, p, x, y);
}
