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