#include <bits/stdc++.h>
using namespace std;
const int MAX = 2e4 + 5;
vector<int> chosen[MAX];
int p;
bool check(int x) {
  int tm = (x / 50);
  tm %= 475;
  for (int i = 1; i <= 25; i++) {
    tm = ((tm * 96) + 42) % 475;
    if (p == (26 + tm)) {
      return true;
    }
  }
  return false;
}
int main() {
  int x, y;
  scanf("%d %d %d", &p, &x, &y);
  int l = x;
  while (l >= y) {
    if (check(l)) {
      printf("0\n");
      exit(0);
    }
    l -= 50;
  }
  int cnt = 0;
  while (!check(x)) {
    x += 50;
    cnt += 1;
  }
  printf("%d\n", (cnt + 1) / 2);
}
