#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
int pos, have, need;
bool ok(int s) {
  int i = (s / 50) % 475;
  for (int rep = (0); rep < (25); ++rep) {
    i = (i * 96 + 42) % 475;
    if (26 + i == pos) return true;
  }
  return false;
}
void run() {
  scanf("%d%d%d", &pos, &have, &need);
  int cur = have;
  while (cur < need) cur += 100;
  while (cur - 50 >= need) cur -= 50;
  while (!ok(cur)) cur += 50;
  int gain = cur - have;
  printf("%d\n", gain < 0 ? 0 : (gain + 50) / 100);
}
int main() {
  run();
  return 0;
}
