#include <bits/stdc++.h>
template <typename T>
using min_heap = std::priority_queue<T, std::vector<T>, std::greater<T>>;
template <typename T>
using max_heap = std::priority_queue<T, std::vector<T>, std::less<T>>;
using namespace std;
int dist(long long curr, long long goal) {
  int rem = (goal - curr) % 100;
  if (rem == 0)
    return ((0) > ((goal - curr) / 100) ? (0) : ((goal - curr) / 100));
  if (rem == 50) return (goal - curr + 50) / 100;
  if (rem == -50) return 0;
  return (1LL << 31) - 1;
}
bool willReach(long long s, int place) {
  int i = (s / 50) % 475;
  for (int j = (0); j < (25); j++) {
    i = (i * 96 + 42) % 475;
    if (26 + i == place) return true;
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int p, x, y;
  cin >> p >> x >> y;
  int ans = (1LL << 31) - 1;
  for (int s = (y); s < (23701); s++) {
    if (!willReach(s, p)) continue;
    int d = dist(x, s);
    ans = ((ans) < (d) ? (ans) : (d));
  }
  cout << ans << "\n";
  return 0;
}
