#include <bits/stdc++.h>
long long p, x, y;
using namespace std;
bool check(long long s) {
  long long i = (s / 50) % 475;
  for (int j = 0; j < 25; j++) {
    i = (i * 96 + 42) % 475;
    if (26 + i == p) return true;
  }
  return false;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> p >> x >> y;
  for (long long i = x; i >= y; i -= 50) {
    if (check(i)) {
      cout << 0;
      return 0;
    }
  }
  long long inc = 0;
  while (1) {
    long long s = x + inc;
    if (check(s)) {
      break;
    }
    inc += 50;
  }
  if (inc % 100 == 0)
    cout << inc / 100;
  else {
    inc += 50;
    cout << inc / 100;
  }
  return 0;
}
