#include <bits/stdc++.h>
using namespace std;
template <class TH>
void _dbg(const char *sdbg, TH h) {
  cerr << sdbg << "=" << h << "\n";
}
template <class TH, class... TA>
void _dbg(const char *sdbg, TH h, TA... a) {
  while (*sdbg != ',') cerr << *sdbg++;
  cerr << "=" << h << ",";
  _dbg(sdbg + 1, a...);
}
long long test;
long long p, x, y;
long long con = 476 * 50;
bool check(long long res) {
  long long i = res / 50;
  i %= 475;
  for (long long j = 1; j <= (25); ++j) {
    i = (i * 96 + 42) % 475;
    if (26 + i == p) {
      return true;
    }
  }
  return false;
}
void solve() {
  cin >> p >> x >> y;
  long long odp = 0;
  long long xd = x;
  while (xd >= y) {
    xd -= 50;
  }
  xd += 50;
  for (long long i = 1; i <= (con); ++i) {
    if (check(xd)) {
      if (xd <= x) {
        cout << 0;
      } else {
        cout << (xd - x) / 100 + ((xd - x) % 100 != 0);
      }
      return;
    }
    xd += 50;
  }
  return;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(10);
  cout << fixed;
  test = 1;
  while (test--) {
    solve();
  }
  return 0;
}
