#include <bits/stdc++.h>
using namespace std;
bool stop;
const int CN = 1e3 + 10;
int main() {
  long long p, x, y;
  set<long long> place;
  cin >> p >> x >> y;
  long long ans = 0, counter1 = 50, counter2 = 50, counterr2 = 50;
  long long xCpy = x, yCpy = y;
  while (xCpy >= yCpy) {
    long long count = 1;
    long long f = (xCpy / 50) % 475;
    while (count != 26) {
      count++;
      f = (f * 96 + 42) % 475;
      place.insert(f + 26);
    }
    if (place.count(p)) {
      cout << 0;
      return 0;
    } else {
      xCpy -= counter1;
      place.clear();
    }
  }
  while (1) {
    long long count = 1;
    long long f = (x / 50) % 475;
    while (count != 26) {
      count++;
      f = (f * 96 + 42) % 475;
      place.insert(f + 26);
    }
    if (place.count(p)) {
      if (counterr2 % 100)
        cout << counterr2 / 100;
      else
        cout << counterr2 / 100;
      return 0;
    } else {
      x += counter2;
      place.clear();
      counterr2 += 50;
    }
  }
  cin >> stop;
  return 0;
}
