#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:33554432")
using namespace std;
int p, yy, xx;
int used[510];
void proc(int s) {
  int i = (s / 50) % 475;
  for (int(j) = (0); j < (25); ++(j)) {
    i = (i * 96 + 42) % 475;
    used[26 + i] = 1;
  }
}
int main() {
  cout.setf(ios::fixed, ios::floatfield);
  cout.precision(12);
  cin >> p >> yy >> xx;
  int tempYY = yy;
  while (yy >= xx) {
    proc(yy);
    if (used[p]) {
      cout << 0 << endl;
      return 0;
    }
    yy -= 50;
  }
  yy = tempYY;
  int ans = 0;
  while (true) {
    ans++;
    yy += 50;
    proc(yy);
    if (used[p]) {
      cout << ans << endl;
      return 0;
    }
    yy += 50;
    proc(yy);
    if (used[p]) {
      cout << ans << endl;
      return 0;
    }
  }
  return 0;
}
