#include <bits/stdc++.h>
using namespace std;
bool gen(long long int p, long long int s) {
  long long int k = (s / 50) % 475;
  for (int i = 0; i < 25; i++) {
    k = (k * 96 + 42) % 475;
    if (p == k + 26) return true;
  }
  return false;
}
int main() {
  int c = 0;
  long long int p, x, y, s;
  bool discover = false;
  cin >> p >> x >> y;
  s = x;
  for (long long int j = s; j >= y; j -= 50) {
    if (gen(p, j)) {
      discover = true;
      break;
    }
  }
  if (!discover) {
    s = x;
    while (!gen(p, s) || s < y) {
      s += 50;
      c++;
    }
  }
  int cm = c % 4;
  int ans = (c / 4) * 2 + (cm + 1) / 2;
  cout << ans << endl;
  return 0;
}
