#include <bits/stdc++.h>
using namespace std;
int desiredrank(int p, int s) {
  int i = (s / 50) % 475;
  for (int j = 0; j < 25; ++j) {
    i = ((i * 96) + 42) % 475;
    if (p == (26 + i)) {
      return 1;
    }
  }
  return 0;
}
int main() {
  int p, x, y;
  int found = 0, shacks = 0;
  int temp;
  cin >> p >> x >> y;
  while (!found) {
    temp = x + 100 * shacks;
    while (temp >= y) {
      if (desiredrank(p, temp)) {
        found = 1;
      }
      temp = temp - 50;
    }
    shacks += 1;
    y = x;
  }
  cout << (shacks - 1);
  return 0;
}
