#include <bits/stdc++.h>
using namespace std;
int p, x, y;
int _mod475(int a) {
  if (a >= 0)
    return a % 475;
  else
    return _mod475(a + 475);
}
bool CanWinTshirt(int s, int p) {
  int count = 0;
  int i = _mod475((int)s / 50);
  while (count < 25) {
    i = _mod475(i * 96 + 42);
    if (p == 26 + i) return true;
    count++;
  }
  return false;
}
bool foundans = 0;
int main() {
  cin >> p >> x >> y;
  int successfulhacks = 0;
  int x_p = x;
  while (x_p >= y) {
    if (CanWinTshirt(x_p, p)) {
      foundans = true;
      break;
    }
    x_p = x_p - 50;
  }
  if (foundans == 1)
    cout << successfulhacks << endl;
  else {
    x_p = x;
    while (foundans == 0) {
      x_p += 50;
      if (CanWinTshirt(x_p, p)) foundans = 1;
      x_p += 50;
      if (CanWinTshirt(x_p, p)) foundans = 1;
      successfulhacks++;
    }
    cout << successfulhacks << endl;
  }
  return 0;
}
