#include <bits/stdc++.h>
using namespace std;
int main() {
  int i;
  int s[25];
  int p, x, y;
  int q;
  bool h;
  h = false;
  cin >> p >> x >> y;
  int f;
  f = x;
  i = (f / 50) % 475;
  for (int j = 0; j < 25; j++) {
    i = (i * 96 + 42) % 475;
    q = 26 + i;
    if ((p == q) && (x >= y)) {
      cout << 0;
      return 0;
    }
  }
  f = x;
  while ((h == false) && (f >= y)) {
    i = (f / 50) % 475;
    for (int j = 0; j < 25; j++) {
      i = (i * 96 + 42) % 475;
      q = 26 + i;
      if ((p == q) && (x >= y)) {
        h = true;
        cout << 0;
        return 0;
      }
    }
    f = f - 50;
  }
  f = x;
  int l;
  l = 0;
  while (h == false) {
    f = f + 50;
    i = (f / 50) % 475;
    for (int j = 0; j < 25; j++) {
      i = (i * 96 + 42) % 475;
      q = 26 + i;
      if ((p == q) && (x >= y)) {
        h = true;
        cout << (f - x + 50) / 100;
        return 0;
      }
    }
  }
}
