#include <bits/stdc++.h>
using namespace std;
int p, real_x, y;
bool can(int r) {
  int i = r % 475;
  int t = 25;
  while (t--) {
    i = (i * 96 + 42) % 475;
    if (26 + i == p) return true;
  }
  return false;
}
int main() {
  cin >> p >> real_x >> y;
  for (int x = real_x; x >= y; x -= 50) {
    if (can(x / 50)) return cout << 0, 0;
  }
  for (int x = real_x, add = 0;; x += 50, add++) {
    if (can(x / 50)) return cout << (add + 1) / 2, 0;
  }
  return 0;
}
