#include <bits/stdc++.h>
using namespace std;
bool ok(long long x, long long p) {
  long long u = (x / 50) % 475;
  for (int(i) = (0); (i) < (25); (i)++) {
    u = (u * 96 + 42) % 475;
    if (u + 26 == p) return true;
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  long long p, x, y;
  cin >> p >> x >> y;
  long long t = 0;
  long long step = 1;
  long long mi = 1e9;
  for (long long k = x; k <= 10000000; k += 50) {
    if (k >= y && ok(k, p)) {
      mi = min(t, mi);
    }
    if (step) {
      t++;
      step = 0;
    } else
      step = 1;
  }
  t = 0;
  step = 1;
  for (long long k = x; k >= y; k -= 50) {
    if (k >= y && ok(k, p)) {
      mi = 0;
    }
  }
  cout << mi << endl;
  return 0;
}
