#include <bits/stdc++.h>
using namespace std;
const int mn = 1000001;
bool shirt(int p, int s) {
  int i = (s / 50) % 475;
  for (int j = 0; j < 25; j++) {
    i = (i * 96 + 42) % 475;
    if ((26 + i) == p) return true;
  }
  return false;
}
int main() {
  int p, x, y;
  cin >> p >> x >> y;
  int al = 0, temp = x;
  while (1 && temp >= y) {
    if (shirt(p, temp)) {
      cout << 0 << endl;
      return 0;
    }
    temp -= 50;
  }
  int ah = 0;
  temp = x;
  while (1) {
    if (shirt(p, temp)) break;
    if ((temp - 50) >= y) {
      if (shirt(p, temp - 50)) break;
    }
    temp += 100;
    ah++;
  }
  int v = temp - x;
  int ans = v / 100;
  cout << ah << endl;
}
