#include <bits/stdc++.h>
using namespace std;
ifstream in("input.txt");
ofstream out("output.txt");
int a[1000][2];
set<long long> s;
int main() {
  long long p, x, y, h;
  cin >> p >> x >> y;
  long long a = x, k = 0;
  while (a >= y && k < 500) {
    long long j = (long long)(a / 50) % 475;
    for (int i = 0; i < 25; i++) {
      j = (j * 96 + 42) % 475;
      if (j + 26 == p) {
        cout << "0";
        return 0;
      }
    }
    k++;
    a -= 50;
  }
  k = 0;
  a = x;
  while (1) {
    long long j = (long long)(a / 50) % 475;
    for (int i = 0; i < 25; i++) {
      j = (j * 96 + 42) % 475;
      if (j + 26 == p) {
        cout << (long long)(ceil(double(a - x) / 100.0));
        return 0;
      }
    }
    a += 50;
  }
  return 0;
}
