#include <bits/stdc++.h>
using namespace std;
inline bool EQ(double a, double b) { return fabs(a - b) < 1e-9; }
inline int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <typename T>
string to_str(T str) {
  stringstream stream;
  stream << str;
  return stream.str();
}
template <typename T>
int to_int(T num) {
  int val;
  stringstream stream;
  stream << num;
  stream >> val;
  return val;
}
vector<string> split(const string& s, char delim) {
  vector<string> elems;
  stringstream ss(s);
  string item;
  while (getline(ss, item, delim)) elems.push_back(item);
  return elems;
}
const int dr[] = {-1, -1, 0, 1, 1, 1, 0, -1};
const int dc[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int T2 = 105;
const int T3 = 1005;
const int T4 = 10005;
const int T5 = 100005;
int a[T3], b[T3];
const int M = 475;
bool check(int s, int p) {
  int i = (s / 50) % M;
  int loop = 25;
  while (loop--) {
    i = (i * 96 + 42) % M;
    if (26 + i == p) {
      return true;
    }
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(0);
  int p, x, y;
  cin >> p >> x >> y;
  int s = x;
  bool f = 0;
  while (s >= y) {
    if (check(s, p)) {
      f = 1;
      break;
    }
    s -= 50;
  }
  if (!f) {
    s = x;
    while (1) {
      if (check(s, p)) {
        f = 1;
        break;
      }
      s += 50;
    }
  }
  int diff = s - x;
  if (diff < 0)
    cout << "0\n";
  else
    cout << ceil(diff * 1.0 / 100) << "\n";
  return 0;
}
